summaryrefslogtreecommitdiffstats
path: root/gst
diff options
context:
space:
mode:
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-06-09 16:00:20 +0000
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>2005-06-09 16:00:20 +0000
commitf836b2f80ea6b793526356155a3773cf594441a4 (patch)
tree8544ca8de8ee44e98bb8df30fee5048de885654b /gst
parent68a233dec1dabfe1a7da0c84a74ef5e1dcb4a43b (diff)
downloadgst-plugins-bad-f836b2f80ea6b793526356155a3773cf594441a4.tar.gz
gst-plugins-bad-f836b2f80ea6b793526356155a3773cf594441a4.tar.bz2
gst-plugins-bad-f836b2f80ea6b793526356155a3773cf594441a4.zip
gst/qtdemux/qtdemux.c: Fix EOS handling (#305150).
Original commit message from CVS: * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header): Fix EOS handling (#305150).
Diffstat (limited to 'gst')
-rw-r--r--gst/qtdemux/qtdemux.c34
1 files changed, 12 insertions, 22 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index f6c5da9a..c92c2a9b 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -105,7 +105,6 @@ enum QtDemuxState
QTDEMUX_STATE_SEEKING,
QTDEMUX_STATE_MOVIE,
QTDEMUX_STATE_SEEKING_EOS,
- QTDEMUX_STATE_EOS
};
static GNode *qtdemux_tree_get_child_by_type (GNode * node, guint32 fourcc);
@@ -700,26 +699,27 @@ gst_qtdemux_loop_header (GstElement * element)
{
guint8 *data;
- do {
+ for (;;) {
ret = gst_bytestream_peek_bytes (qtdemux->bs, &data, 1);
if (ret < 1) {
if (gst_qtdemux_handle_sink_event (qtdemux)) {
- return;
+ continue;
} else {
- break;
+ return;
}
} else {
- break;
- }
- } while (TRUE);
- gst_element_set_eos (element);
+ guint32 remain;
- qtdemux->state = QTDEMUX_STATE_EOS;
+ gst_bytestream_get_status (qtdemux->bs, &remain, NULL);
+ if (!gst_bytestream_seek (qtdemux->bs, 0, GST_SEEK_METHOD_END)) {
+ gst_bytestream_flush_fast (qtdemux->bs, remain);
+ }
+ return;
+ }
+ }
+ while (TRUE);
return;
}
- case QTDEMUX_STATE_EOS:
- g_warning ("spinning in EOS\n");
- return;
case QTDEMUX_STATE_MOVIE:
{
QtDemuxStream *stream;
@@ -739,16 +739,6 @@ gst_qtdemux_loop_header (GstElement * element)
}
if (index == -1) {
- for (i = 0; i < qtdemux->n_streams; i++) {
- gst_pad_push (qtdemux->streams[i]->pad,
- GST_DATA (gst_event_new (GST_EVENT_EOS)));
- }
- ret = gst_bytestream_seek (qtdemux->bs, 0, GST_SEEK_METHOD_END);
- if (ret == FALSE) {
- gst_bytestream_flush (qtdemux->bs, 0xffffffff);
- }
- GST_DEBUG ("seek returned %d", ret);
-
qtdemux->state = QTDEMUX_STATE_SEEKING_EOS;
return;
}