Commit c688eb0d authored by Wim Taymans's avatar Wim Taymans

audiotestsrc: add support for unlimited number of channels

Raise the channel limit and set the channel-mask for > 2 channels.
parent b0bf294a
......@@ -267,6 +267,7 @@ gst_audio_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
{
GstAudioTestSrc *src = GST_AUDIO_TEST_SRC (bsrc);
GstStructure *structure;
gint channels;
caps = gst_caps_make_writable (caps);
......@@ -282,6 +283,13 @@ gst_audio_test_src_fixate (GstBaseSrc * bsrc, GstCaps * caps)
/* fixate to mono unless downstream requires stereo, for backwards compat */
gst_structure_fixate_field_nearest_int (structure, "channels", 1);
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,
NULL);
}
caps = GST_BASE_SRC_CLASS (parent_class)->fixate (bsrc, caps);
return caps;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment