summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2009-04-21 16:08:55 +0200
committerDave Robillard <dave@drobilla.net>2009-05-03 12:03:16 -0400
commit0baf8a4b0e65efd658f8083d170245286557aff5 (patch)
treefc098811695959966fa069ee77f0449553ef7880
parentf82893cfc2fa7dfd780fa3517371fd0db83f2e02 (diff)
downloadgst-plugins-bad-0baf8a4b0e65efd658f8083d170245286557aff5.tar.gz
gst-plugins-bad-0baf8a4b0e65efd658f8083d170245286557aff5.tar.bz2
gst-plugins-bad-0baf8a4b0e65efd658f8083d170245286557aff5.zip
mpegdemux: Only error out at EOS push failure if we don't have any streams.
This should remove the bogus error messages while still keeping the original intent of this, which is to inform the pipeline/application/user that we could not find any valid streams. There are many reasons why pushing an event can fail, and not all of them are because there's no link downstream (it could be because it was blocked, or flushing).
-rw-r--r--gst/mpegdemux/gstmpegdemux.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c
index 40f778f0..439bb563 100644
--- a/gst/mpegdemux/gstmpegdemux.c
+++ b/gst/mpegdemux/gstmpegdemux.c
@@ -790,6 +790,19 @@ gst_flups_demux_close_segment (GstFluPSDemux * demux)
}
}
+static inline gboolean
+have_open_streams (GstFluPSDemux * demux)
+{
+ gint id;
+
+ for (id = 0; id < GST_FLUPS_DEMUX_MAX_STREAMS; id++) {
+ if (demux->streams[id])
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static gboolean
gst_flups_demux_sink_event (GstPad * pad, GstEvent * event)
{
@@ -861,10 +874,11 @@ gst_flups_demux_sink_event (GstPad * pad, GstEvent * event)
}
case GST_EVENT_EOS:
GST_INFO_OBJECT (demux, "Received EOS");
- if (!gst_flups_demux_send_event (demux, event)) {
- GST_WARNING_OBJECT (demux, "failed pushing EOS on streams");
+ if (!gst_flups_demux_send_event (demux, event)
+ && !have_open_streams (demux)) {
+ GST_WARNING_OBJECT (demux, "EOS and no streams open");
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
- ("Internal data stream error."), ("Can't push EOS downstream"));
+ ("Internal data stream error."), ("No valid streams detected"));
}
break;
case GST_EVENT_CUSTOM_DOWNSTREAM:
@@ -2515,10 +2529,11 @@ pause:
/* normal playback, send EOS to all linked pads */
gst_element_no_more_pads (GST_ELEMENT (demux));
GST_LOG_OBJECT (demux, "Sending EOS, at end of stream");
- if (!gst_flups_demux_send_event (demux, gst_event_new_eos ())) {
- GST_WARNING_OBJECT (demux, "failed pushing EOS on streams");
+ if (!gst_flups_demux_send_event (demux, gst_event_new_eos ())
+ && !have_open_streams (demux)) {
+ GST_WARNING_OBJECT (demux, "EOS and no streams open");
GST_ELEMENT_ERROR (demux, STREAM, FAILED,
- ("Internal data stream error."), ("Can't push EOS downstream"));
+ ("Internal data stream error."), ("No valid streams detected"));
}
}
} else {