osxaudiosink: Only fix up channels/layout for PCM caps while probing

It's unlikely that setting a channel layout will do much for AC3/DTS
streams. If we find at some point that it does make sense, we can
perform the structure copying unconditionally (i.e., the current code is
wrong, since AC3/DTS will get two structures now - one with the channel
layout, one without).

https://bugzilla.gnome.org/show_bug.cgi?id=740987
This commit is contained in:
Arun Raghavan 2014-12-01 20:32:04 +05:30
parent bd1502862c
commit df610a7c18

View file

@ -691,13 +691,14 @@ gst_osx_audio_sink_probe_caps (GstOsxAudioSink * osxsink)
if (spdif_allowed) {
gst_caps_append_structure (caps, gst_structure_copy (in_s));
}
} else {
gst_audio_channel_positions_to_mask (pos, channels, false, &channel_mask);
out_s = gst_structure_copy (in_s);
gst_structure_remove_fields (out_s, "channels", "channel-mask", NULL);
gst_structure_set (out_s, "channels", G_TYPE_INT, channels,
"channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
gst_caps_append_structure (caps, out_s);
}
gst_audio_channel_positions_to_mask (pos, channels, false, &channel_mask);
out_s = gst_structure_copy (in_s);
gst_structure_remove_fields (out_s, "channels", "channel-mask", NULL);
gst_structure_set (out_s, "channels", G_TYPE_INT, channels,
"channel-mask", GST_TYPE_BITMASK, channel_mask, NULL);
gst_caps_append_structure (caps, out_s);
}
if (osxsink->cached_caps) {