summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Decina <alessandro.decina@collabora.co.uk>2010-09-15 18:21:11 +0200
committerAlessandro Decina <alessandro.decina@collabora.co.uk>2010-09-15 18:27:24 +0200
commit3605bd454aa8d666fe2e724c56801e914f24da0b (patch)
tree703a2e77b5b0e80b3782dc4de86f7b9b125a99fb
parent601b993f956c3a5dd61862e98bb2b313d41f85f5 (diff)
qtdemux: fix logic when pushing EOS.
Don't check for return values when pushing EOS. Still post an error if EOS is reached and no streams have been found.
-rw-r--r--gst/qtdemux/qtdemux.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/gst/qtdemux/qtdemux.c b/gst/qtdemux/qtdemux.c
index 1c091bd50..399745784 100644
--- a/gst/qtdemux/qtdemux.c
+++ b/gst/qtdemux/qtdemux.c
@@ -708,7 +708,7 @@ static void
gst_qtdemux_push_event (GstQTDemux * qtdemux, GstEvent * event)
{
guint n;
- gboolean pushed_sucessfully = FALSE;
+ gboolean has_valid_stream = FALSE;
GstEventType etype = GST_EVENT_TYPE (event);
GST_DEBUG_OBJECT (qtdemux, "pushing %s event on all source pads",
@@ -718,17 +718,20 @@ gst_qtdemux_push_event (GstQTDemux * qtdemux, GstEvent * event)
GstPad *pad;
QtDemuxStream *stream = qtdemux->streams[n];
- if (etype == GST_EVENT_EOS && stream->sent_eos)
- pushed_sucessfully = TRUE;
- else if ((pad = stream->pad)) {
- if (gst_pad_push_event (pad, gst_event_ref (event)))
- pushed_sucessfully = TRUE;
+ if ((pad = stream->pad)) {
+ has_valid_stream = TRUE;
+
+ if (etype == GST_EVENT_EOS)
+ stream->sent_eos = TRUE;
+
+ gst_pad_push_event (pad, gst_event_ref (event));
}
}
+
gst_event_unref (event);
- /* if it is EOS and nothing is pushed, post an error */
- if (!pushed_sucessfully && etype == GST_EVENT_EOS) {
+ /* if it is EOS and there are no pads, post an error */
+ if (!has_valid_stream && etype == GST_EVENT_EOS) {
gst_qtdemux_post_no_playable_stream_error (qtdemux);
}
}