summaryrefslogtreecommitdiff
path: root/gst-libs/gst/audio/gstaudioaggregator.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst-libs/gst/audio/gstaudioaggregator.c')
-rw-r--r--gst-libs/gst/audio/gstaudioaggregator.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gst-libs/gst/audio/gstaudioaggregator.c b/gst-libs/gst/audio/gstaudioaggregator.c
index 02d4128d8..e75b8e53e 100644
--- a/gst-libs/gst/audio/gstaudioaggregator.c
+++ b/gst-libs/gst/audio/gstaudioaggregator.c
@@ -773,6 +773,7 @@ gst_audio_aggregator_fixate_src_caps (GstAggregator * agg, GstCaps * caps)
GstCaps *first_configured_caps =
gst_audio_info_to_caps (&first_configured_pad->info);
gint first_configured_rate, first_configured_channels;
+ gint channels;
caps = gst_caps_make_writable (caps);
s = gst_caps_get_structure (caps, 0);
@@ -789,6 +790,18 @@ gst_audio_aggregator_fixate_src_caps (GstAggregator * agg, GstCaps * caps)
gst_structure_fixate_field_nearest_int (s, "channels",
first_configured_channels);
+ gst_structure_get_int (s, "channels", &channels);
+
+ if (!gst_structure_has_field (s, "channel-mask") && channels > 2) {
+ guint64 mask;
+
+ if (!gst_structure_get (s2, "channel-mask", GST_TYPE_BITMASK, &mask,
+ NULL)) {
+ mask = gst_audio_channel_get_fallback_mask (channels);
+ }
+ gst_structure_set (s, "channel-mask", GST_TYPE_BITMASK, mask, NULL);
+ }
+
gst_caps_unref (first_configured_caps);
gst_object_unref (first_configured_pad);
}