From 0025741d775d2c92493bc248394a9142c8b42cde Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Sun, 27 Oct 2002 23:01:39 +0000 Subject: asf content detection for seekable, but non-preview input plugins CVS patchset: 3056 CVS date: 2002/10/27 23:01:39 --- src/demuxers/demux_asf.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 2cbb790d9..7e436c270 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: demux_asf.c,v 1.71 2002/10/26 22:00:49 guenter Exp $ + * $Id: demux_asf.c,v 1.72 2002/10/27 23:01:40 guenter Exp $ * * demultiplexer for asf streams * @@ -1426,9 +1426,17 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, * try to get a preview of the data */ len = input->get_optional_data (input, buf, INPUT_OPTIONAL_DATA_PREVIEW); - if (len == INPUT_OPTIONAL_UNSUPPORTED) - return NULL; - + if (len == INPUT_OPTIONAL_UNSUPPORTED) { + + if (input->get_capabilities (input) & INPUT_CAP_SEEKABLE) { + + input->seek (input, 0, SEEK_SET); + if (input->read (input, buf, 8192) != 8192) + return NULL; + + } else + return NULL; + } if (memcmp(buf, &asf_header, sizeof(GUID))) return NULL; -- cgit v1.2.3