mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-29 23:32:33 +00:00
audioconvert: Consider channel=1, channel-mask=0x0 as mono
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
This commit is contained in:
parent
01f4d6494a
commit
ffd4c990c1
1 changed files with 4 additions and 2 deletions
|
@ -244,7 +244,7 @@ static GstCaps *
|
||||||
gst_audio_convert_caps_remove_format_info (GstCaps * caps, gboolean channels)
|
gst_audio_convert_caps_remove_format_info (GstCaps * caps, gboolean channels)
|
||||||
{
|
{
|
||||||
GstStructure *st;
|
GstStructure *st;
|
||||||
gint i, n;
|
gint i, n, n_channels;
|
||||||
GstCaps *res;
|
GstCaps *res;
|
||||||
guint64 channel_mask;
|
guint64 channel_mask;
|
||||||
|
|
||||||
|
@ -267,7 +267,9 @@ gst_audio_convert_caps_remove_format_info (GstCaps * caps, gboolean channels)
|
||||||
/* Only remove the channels and channel-mask for non-NONE layouts */
|
/* Only remove the channels and channel-mask for non-NONE layouts */
|
||||||
if (gst_structure_get (st, "channel-mask", GST_TYPE_BITMASK, &channel_mask,
|
if (gst_structure_get (st, "channel-mask", GST_TYPE_BITMASK, &channel_mask,
|
||||||
NULL)) {
|
NULL)) {
|
||||||
if (channel_mask != 0)
|
if (channel_mask != 0
|
||||||
|
|| (gst_structure_get_int (st, "channels", &n_channels)
|
||||||
|
&& (n_channels == 1)))
|
||||||
remove_channels = TRUE;
|
remove_channels = TRUE;
|
||||||
} else {
|
} else {
|
||||||
remove_channels = TRUE;
|
remove_channels = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue