wavenc: Allow setcaps to be called after a format was negotiated if it's compatible
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Fri, 29 Apr 2011 06:55:19 +0000 (08:55 +0200)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Wed, 15 Jun 2011 20:06:49 +0000 (21:06 +0100)
Otherwise wavenc will fail if upstream decides to set equivalent caps or caps
with additional information later.

Thanks to Alexander Schremmer for finding this bug.

gst/wavenc/gstwavenc.c

index c3b0c57..7db0e18 100644 (file)
@@ -275,7 +275,7 @@ gst_wavenc_sink_setcaps (GstPad * pad, GstCaps * caps)
 
   wavenc = GST_WAVENC (gst_pad_get_parent (pad));
 
-  if (wavenc->sent_header) {
+  if (wavenc->sent_header && !gst_caps_can_intersect (caps, GST_PAD_CAPS (pad))) {
     GST_WARNING_OBJECT (wavenc, "cannot change format in middle of stream");
     goto fail;
   }