audiopanorama: fix negotiation and unit test
authorTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 3 Jul 2012 16:52:11 +0000 (17:52 +0100)
committerTim-Philipp Müller <tim.muller@collabora.co.uk>
Tue, 3 Jul 2012 16:54:22 +0000 (17:54 +0100)
Must remove a possibly-fixed channel-mask field if
we're going to set unfixed channels on the structure,
or a different channel count.

gst/audiofx/audiopanorama.c

index 3d0d68f..e257c36 100644 (file)
@@ -334,9 +334,11 @@ gst_audio_panorama_transform_caps (GstBaseTransform * base,
   if (direction == GST_PAD_SRC) {
     GST_INFO ("allow 1-2 channels");
     gst_structure_set (structure, "channels", GST_TYPE_INT_RANGE, 1, 2, NULL);
+    gst_structure_remove_field (structure, "channel-mask");
   } else {
     GST_INFO ("allow 2 channels");
     gst_structure_set (structure, "channels", G_TYPE_INT, 2, NULL);
+    gst_structure_remove_field (structure, "channel-mask");
   }
 
   return res;