mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
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.
This commit is contained in:
parent
601b993f95
commit
3605bd454a
1 changed files with 11 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue