2 * This file is part of MPlayer.
4 * MPlayer is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * MPlayer is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include "stream/stream.h"
26 static int try_open_file(struct demuxer
*demuxer
)
28 struct stream
*s
= demuxer
->stream
;
29 const char header
[] = "mplayer EDL file";
30 const int len
= sizeof(header
) - 1;
32 if (stream_read(s
, buf
, len
) < len
)
34 if (strncmp(buf
, header
, len
))
37 demuxer
->file_contents
= stream_read_complete(s
, demuxer
, 1000000, 0);
38 if (demuxer
->file_contents
.start
== NULL
)
40 return DEMUXER_TYPE_EDL
;
43 static int dummy_fill_buffer(struct demuxer
*demuxer
, struct demux_stream
*ds
)
48 const struct demuxer_desc demuxer_desc_edl
= {
49 .info
= "EDL file demuxer",
52 .author
= "Uoti Urpala",
54 .type
= DEMUXER_TYPE_EDL
,
56 .check_file
= try_open_file
, // no separate .open
57 .fill_buffer
= dummy_fill_buffer
,