summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2016-06-29 18:14:51 +0200
committerSebastian Dröge <sebastian@centricular.com>2016-07-04 12:44:02 +0200
commit7921dc34b869fe24ac6f3d8dc3e349e280b400ab (patch)
treeebae070daa7a1dca81ede6f165f4f44372ce9937
parent0fd14074fb214b44bc2d4be9b83fd558335c5e45 (diff)
downloadgstreamer-plugins-base-7921dc34b869fe24ac6f3d8dc3e349e280b400ab.tar.gz
audioconvert: Handle fallback channel mask for mono correctly
It's 0 and no mask should be set for mono at all. https://bugzilla.gnome.org/show_bug.cgi?id=757472
-rw-r--r--gst-libs/gst/audio/audio-channels.c2
-rw-r--r--gst/audioconvert/gstaudioconvert.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/gst-libs/gst/audio/audio-channels.c b/gst-libs/gst/audio/audio-channels.c
index b358cc2a4..8e0345596 100644
--- a/gst-libs/gst/audio/audio-channels.c
+++ b/gst-libs/gst/audio/audio-channels.c
@@ -524,7 +524,7 @@ static const guint64 default_masks[] = {
* called as a last resort when the specific channel map is unknown.
*
* Returns: a fallback channel-mask for @channels or 0 when there is no
- * mask.
+ * mask and mono.
*
* Since: 1.8
*/
diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c
index a3a8fad32..606fc597b 100644
--- a/gst/audioconvert/gstaudioconvert.c
+++ b/gst/audioconvert/gstaudioconvert.c
@@ -575,12 +575,12 @@ gst_audio_convert_fixate_channels (GstBaseTransform * base, GstStructure * ins,
* one reason or another, so just pick a default layout (we could be smarter
* and try to add/remove channels from the input layout, or pick a default
* layout based on LFE-presence in input layout, but let's save that for
- * another day) */
- if (out_chans > 0
+ * another day). For mono, no mask is required and the fallback mask is 0 */
+ if (out_chans > 1
&& (out_mask = gst_audio_channel_get_fallback_mask (out_chans))) {
GST_DEBUG_OBJECT (base, "using default channel layout as fallback");
gst_structure_set (outs, "channel-mask", GST_TYPE_BITMASK, out_mask, NULL);
- } else {
+ } else if (out_chans > 1) {
GST_ERROR_OBJECT (base, "Have no default layout for %d channels",
out_chans);
}