channels=1 is always mono, having it 'unpositioned' does not make
sense.
This fixes pipeline such as:
gst-validate-1.0 audiotestsrc ! audio/x-raw,channels=2,rate=44100,layout=interleaved ! audioconvert ! audioresample ! audio/x-raw, rate=44100, channels=1 ! avenc_mp2 ! fakesink
https://bugzilla.gnome.org/show_bug.cgi?id=785407
gst_audio_convert_caps_remove_format_info (GstCaps * caps, gboolean channels)
{
GstStructure *st;
- gint i, n;
+ gint i, n, n_channels;
GstCaps *res;
guint64 channel_mask;
/* Only remove the channels and channel-mask for non-NONE layouts */
if (gst_structure_get (st, "channel-mask", GST_TYPE_BITMASK, &channel_mask,
NULL)) {
- if (channel_mask != 0)
+ if (channel_mask != 0
+ || (gst_structure_get_int (st, "channels", &n_channels)
+ && (n_channels == 1)))
remove_channels = TRUE;
} else {
remove_channels = TRUE;