From 4f3815cb3a8e4648cbb7f69f97b4f74ac7439edc Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Sat, 4 Dec 2004 11:44:47 +0000 Subject: gst/apetag/apedemux.c: Let's make sure we're done typefinding when detecting tags. Original commit message from CVS: * gst/apetag/apedemux.c: (gst_ape_demux_stream_init): Let's make sure we're done typefinding when detecting tags. --- ChangeLog | 5 +++++ gst/apetag/apedemux.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4baa93ad7..f61410428 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-12-04 Ronald S. Bultje + + * gst/apetag/apedemux.c: (gst_ape_demux_stream_init): + Let's make sure we're done typefinding when detecting tags. + 2004-12-03 Ronald S. Bultje * gst/matroska/ebml-read.c: (gst_ebml_read_class_init), diff --git a/gst/apetag/apedemux.c b/gst/apetag/apedemux.c index 8767f1c35..0722595c8 100644 --- a/gst/apetag/apedemux.c +++ b/gst/apetag/apedemux.c @@ -524,6 +524,14 @@ gst_ape_demux_stream_init (GstApeDemux * ape) /* start off, we'll want byte-reading here */ bs = gst_bytestream_new (ape->sinkpad); + /* peek one byte to not confuse the typefinder */ + while (gst_bytestream_peek_bytes (bs, &data, 1) != 1) { + if (!gst_ape_demux_handle_event (ape, bs)) { + res = FALSE; + goto the_city; + } + } + /* can we seek? */ if (!gst_bytestream_seek (bs, 0, GST_SEEK_METHOD_END)) { seekable = FALSE; @@ -599,6 +607,7 @@ gst_ape_demux_stream_init (GstApeDemux * ape) goto the_city; } } + if (!memcmp (data, "APETAGEX", 8)) { GST_LOG ("Found tags at end"); -- cgit v1.2.1