From 96d8ff7f328532cb057d4ff53eebd1718d9849c1 Mon Sep 17 00:00:00 2001 From: Conrad Parker Date: Tue, 21 Dec 2004 05:24:47 +0000 Subject: add BY_CONTENT method for detecting DV streams CVS patchset: 7291 CVS date: 2004/12/21 05:24:47 --- src/demuxers/demux_rawdv.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c index 5dc554cbe..a0bbfdab1 100644 --- a/src/demuxers/demux_rawdv.c +++ b/src/demuxers/demux_rawdv.c @@ -19,7 +19,7 @@ */ /* - * $Id: demux_rawdv.c,v 1.21 2004/06/13 21:28:54 miguelfreitas Exp $ + * $Id: demux_rawdv.c,v 1.22 2004/12/21 05:24:47 conrad Exp $ * * demultiplexer for raw dv streams */ @@ -357,6 +357,21 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str switch (stream->content_detection_method) { + case METHOD_BY_CONTENT: { + uint8_t buf[8]; + + if (_x_demux_read_header(input, buf, 8) != 8) + return 0; + + /* DIF (DV) movie file */ + if (!((buf[0] == 0x1f) && (buf[1] == 0x07) && (buf[2] == 00) && + (buf[4] ^ 0x01))) { + free (this); + return NULL; + } + } + break; + case METHOD_BY_EXTENSION: { char *extensions, *mrl; -- cgit v1.2.3