avdemux: fix not-negotiated errors
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 28 Sep 2012 15:53:49 +0000 (16:53 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Fri, 28 Sep 2012 15:53:49 +0000 (16:53 +0100)
Drop caps event received on the sink pad, instead of
putting it in the list of cached events to be sent
downstream later. We don't want to send our container
caps downstream to our decoders, that'll give us
nasty not-negotiated errors.

https://bugzilla.gnome.org/show_bug.cgi?id=680464

ext/libav/gstavdemux.c

index bbe5d8e..bee67a5 100644 (file)
@@ -1000,6 +1000,7 @@ gst_ffmpegdemux_get_stream (GstFFMpegDemux * demux, AVStream * avstream)
   gst_pad_push_event (pad, gst_event_new_stream_start (stream_id));
   g_free (stream_id);
 
+  GST_INFO_OBJECT (pad, "adding pad with caps %" GST_PTR_FORMAT, caps);
   gst_pad_set_caps (pad, caps);
   gst_caps_unref (caps);
 
@@ -1603,6 +1604,11 @@ gst_ffmpegdemux_sink_event (GstPad * sinkpad, GstObject * parent,
       /* eat this event for now, task will send eos when finished */
       gst_event_unref (event);
       goto done;
+    case GST_EVENT_STREAM_START:
+    case GST_EVENT_CAPS:
+      GST_LOG_OBJECT (demux, "dropping %s event", GST_EVENT_TYPE_NAME (event));
+      gst_event_unref (event);
+      goto done;
     default:
       /* for a serialized event, wait until an earlier data is gone,
        * though this is no guarantee as to when task is done with it.