From 64ac6a1d164a64864286e5c3afb5387af625492f Mon Sep 17 00:00:00 2001 From: Vivia Nikolaidou Date: Mon, 24 Jan 2022 12:57:10 +0200 Subject: [PATCH] audiotestsrc: Produce a default channel mask if possible https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/issues/957 Part-of: --- subprojects/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/subprojects/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c b/subprojects/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c index b8554ed..a15fe5b 100644 --- a/subprojects/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c +++ b/subprojects/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c @@ -382,9 +382,11 @@ gst_audio_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps) if (gst_structure_get_int (structure, "channels", &channels) && channels > 2) { if (!gst_structure_has_field_typed (structure, "channel-mask", - GST_TYPE_BITMASK)) - gst_structure_set (structure, "channel-mask", GST_TYPE_BITMASK, 0ULL, + GST_TYPE_BITMASK)) { + guint64 mask = gst_audio_channel_get_fallback_mask (channels); + gst_structure_set (structure, "channel-mask", GST_TYPE_BITMASK, mask, NULL); + } } caps = GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps); -- 2.7.4