flacenc: fix get_caps function some more so that all structures have channel info

Set channels and channel-layout on the right structure; that is, the
structure we are going to append to the caps we are building, and not
the structure we are using as a template for all the structures. Fixes
first structure of the returned caps not having any channel info set
on it.
This commit is contained in:
Tim-Philipp Müller 2012-02-22 17:39:16 +00:00
parent f0b076212f
commit 3e9f191262

View file

@ -644,13 +644,13 @@ gst_flac_enc_getcaps (GstAudioEncoder * enc, GstCaps * filter)
s2 = gst_structure_copy (s); s2 = gst_structure_copy (s);
if (i == 1) { if (i == 1) {
gst_structure_set (s, "channels", G_TYPE_INT, 1, NULL); gst_structure_set (s2, "channels", G_TYPE_INT, 1, NULL);
} else { } else {
guint64 channel_mask; guint64 channel_mask;
gst_audio_channel_positions_to_mask (channel_positions[i - 1], i, gst_audio_channel_positions_to_mask (channel_positions[i - 1], i,
&channel_mask); &channel_mask);
gst_structure_set (s, "channels", G_TYPE_INT, i, "channel-mask", gst_structure_set (s2, "channels", G_TYPE_INT, i, "channel-mask",
GST_TYPE_BITMASK, channel_mask, NULL); GST_TYPE_BITMASK, channel_mask, NULL);
} }