audiopanorama: fix negotiation and unit test

Must remove a possibly-fixed channel-mask field if
we're going to set unfixed channels on the structure,
or a different channel count.
This commit is contained in:
Tim-Philipp Müller 2012-07-03 17:52:11 +01:00
parent 407bf06dc4
commit 0fa3992e37

View 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;