summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-04-18 13:04:59 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-04-18 13:04:59 +0000
commit6fc5d76986dedd3defafa72dd98d4e5a35d54d8e (patch)
tree145666c1657455bb0d01116909c77afd7eb000b1 /gst
parent71abdc5dace6493e2ffbfb268816c53c353dbf49 (diff)
downloadgst-plugins-bad-6fc5d76986dedd3defafa72dd98d4e5a35d54d8e.tar.gz
gst-plugins-bad-6fc5d76986dedd3defafa72dd98d4e5a35d54d8e.tar.bz2
gst-plugins-bad-6fc5d76986dedd3defafa72dd98d4e5a35d54d8e.zip
gst/qtdemux/qtdemux.c: Prevent hangs that I apparently introduced a while ago.
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header): Prevent hangs that I apparently introduced a while ago.
Diffstat (limited to 'gst')
-rw-r--r--gst/qtdemux/qtdemux.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index acb5f8a4..b9350097 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -628,7 +628,7 @@ gst_qtdemux_loop_header (GstElement * element)
case GST_MAKE_FOURCC ('w', 'i', 'd', 'e'):
case GST_MAKE_FOURCC ('P', 'I', 'C', 'T'):
case GST_MAKE_FOURCC ('p', 'n', 'o', 't'):
- break;
+ goto the_d;
case GST_MAKE_FOURCC ('m', 'o', 'o', 'v'):
{
GstBuffer *moov;
@@ -659,11 +659,22 @@ gst_qtdemux_loop_header (GstElement * element)
qtdemux->state = QTDEMUX_STATE_MOVIE;
break;
}
+ the_d:
default:
{
+ guint32 pending;
+
GST_LOG ("unknown %08x '" GST_FOURCC_FORMAT "' at %d",
fourcc, GST_FOURCC_ARGS (fourcc), cur_offset);
- gst_bytestream_flush (qtdemux->bs, length);
+ gst_bytestream_get_status (qtdemux->bs, &pending, NULL);
+ if (length <= pending)
+ gst_bytestream_flush_fast (qtdemux->bs, length);
+ else {
+ offset = cur_offset + length;
+ if (!gst_bytestream_seek (qtdemux->bs, offset, GST_SEEK_METHOD_SET)) {
+ gst_bytestream_flush (qtdemux->bs, length);
+ }
+ }
break;
}
}