mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
flacenc: remove single entry if from loop
Iterate from the 2nd channel on and create the 1 channel struct outside to make loop structure simpler and only slightly faster.
This commit is contained in:
parent
a00546e078
commit
0899529222
1 changed files with 10 additions and 12 deletions
|
@ -739,19 +739,17 @@ gst_flac_enc_generate_sink_caps (void)
|
|||
"rate", GST_TYPE_INT_RANGE, 1, 655350, NULL);
|
||||
|
||||
ret = gst_caps_new_empty ();
|
||||
for (i = 1; i <= 8; i++) {
|
||||
s2 = gst_structure_copy (s);
|
||||
|
||||
if (i == 1) {
|
||||
gst_structure_set (s2, "channels", G_TYPE_INT, 1, NULL);
|
||||
} else {
|
||||
gst_caps_append_structure (ret, s2);
|
||||
for (i = 2; i <= 8; i++) {
|
||||
guint64 channel_mask;
|
||||
|
||||
s2 = gst_structure_copy (s);
|
||||
gst_audio_channel_positions_to_mask (channel_positions[i - 1], i,
|
||||
FALSE, &channel_mask);
|
||||
gst_structure_set (s2, "channels", G_TYPE_INT, i, "channel-mask",
|
||||
GST_TYPE_BITMASK, channel_mask, NULL);
|
||||
}
|
||||
|
||||
gst_caps_append_structure (ret, s2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue