gst/avi/gstavidemux.c: Make _push_event() return TRUE if the event could be pushed...
authorTim-Philipp Müller <tim@centricular.net>
Wed, 30 May 2007 12:46:32 +0000 (12:46 +0000)
committerTim-Philipp Müller <tim@centricular.net>
Wed, 30 May 2007 12:46:32 +0000 (12:46 +0000)
Original commit message from CVS:
* gst/avi/gstavidemux.c: (gst_avi_demux_push_event),
(gst_avi_demux_loop):
Make _push_event() return TRUE if the event could be pushed on at
least one pad and not only if it could be pushed on all pads,
otherwise we'll end up posting an error message on EOS if one or
more source pads are not connected.

ChangeLog
gst/avi/gstavidemux.c

index 9cf5cdf..3c85b07 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-05-30  Tim-Philipp Müller  <tim at centricular dot net>
+
+       * gst/avi/gstavidemux.c: (gst_avi_demux_push_event),
+       (gst_avi_demux_loop):
+         Make _push_event() return TRUE if the event could be pushed on at
+         least one pad and not only if it could be pushed on all pads,
+         otherwise we'll end up posting an error message on EOS if one or
+         more source pads are not connected.
+
 2007-05-28  Wim Taymans  <wim@fluendo.com>
 
        * gst/rtsp/rtsptransport.c:
index 8994455..54ecb12 100644 (file)
@@ -2451,22 +2451,22 @@ gst_avi_demux_calculate_durations_from_index (GstAviDemux * avi)
 static gboolean
 gst_avi_demux_push_event (GstAviDemux * avi, GstEvent * event)
 {
+  gboolean result = FALSE;
   gint i;
-  gboolean result = TRUE;
 
-  GST_DEBUG_OBJECT (avi, "sending event to %d streams", avi->num_streams);
+  GST_DEBUG_OBJECT (avi, "sending %s event to %d streams",
+      GST_EVENT_TYPE_NAME (event), avi->num_streams);
+
   if (avi->num_streams) {
     for (i = 0; i < avi->num_streams; i++) {
       avi_stream_context *stream = &avi->stream[i];
 
       if (stream->pad) {
         gst_event_ref (event);
-        result &= gst_pad_push_event (stream->pad, event);
+        if (gst_pad_push_event (stream->pad, event))
+          result = TRUE;
       }
     }
-  } else {
-    /* return error, as the event was not send */
-    result = FALSE;
   }
   gst_event_unref (event);
   return result;
@@ -3725,9 +3725,10 @@ pause:
     if (push_eos) {
       GST_INFO_OBJECT (avi, "sending eos");
       if (!(gst_avi_demux_push_event (avi, gst_event_new_eos ()))) {
-        /* if we don't error out here it will hand */
+        /* if we don't error out here it will hang */
         GST_ELEMENT_ERROR (avi, STREAM, FAILED,
-            (_("Internal data stream error.")), ("corrupted file"));
+            (_("Internal data stream error.")),
+            ("downstream did not handle EOS"));
       }
     }
   }