gst/audioconvert/gstchannelmix.c: If mixing left or right to center (or the other way around) only take the complete ...

Original commit message from CVS:
* gst/audioconvert/gstchannelmix.c:
(gst_channel_mix_fill_one_other):
If mixing left or right to center (or the other way around) only take
the complete value if we don't already have the original position in
the source.
This commit is contained in:
Sebastian Dröge 2008-05-29 12:17:16 +00:00
parent 45ef6b5e13
commit b86a5d4303
2 changed files with 22 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2008-05-29 Sebastian Dröge <slomo@circular-chaos.org>
* gst/audioconvert/gstchannelmix.c:
(gst_channel_mix_fill_one_other):
If mixing left or right to center (or the other way around) only take
the complete value if we don't already have the original position in
the source.
2008-05-29 Sebastian Dröge <slomo@circular-chaos.org>
* gst-libs/gst/audio/multichannel.c:

View file

@ -267,20 +267,30 @@ gst_channel_mix_fill_one_other (gfloat ** matrix,
}
/* src has left & dst has center => put into center */
if (from_idx[0] != -1 && to_idx[1] != -1) {
if (from_idx[0] != -1 && to_idx[1] != -1 && from_idx[1] != -1) {
matrix[from_idx[0]][to_idx[1]] = 0.5 * ratio;
} else if (from_idx[0] != -1 && to_idx[1] != -1 && from_idx[1] == -1) {
matrix[from_idx[0]][to_idx[1]] = ratio;
}
/* src has right & dst has center => put into center */
if (from_idx[2] != -1 && to_idx[1] != -1) {
if (from_idx[2] != -1 && to_idx[1] != -1 && from_idx[1] != -1) {
matrix[from_idx[2]][to_idx[1]] = 0.5 * ratio;
} else if (from_idx[2] != -1 && to_idx[1] != -1 && from_idx[1] == -1) {
matrix[from_idx[2]][to_idx[1]] = ratio;
}
/* src has center & dst has left => passthrough */
if (from_idx[1] != -1 && to_idx[0] != -1) {
if (from_idx[1] != -1 && to_idx[0] != -1 && from_idx[0] != -1) {
matrix[from_idx[1]][to_idx[0]] = 0.5 * ratio;
} else if (from_idx[1] != -1 && to_idx[0] != -1 && from_idx[0] == -1) {
matrix[from_idx[1]][to_idx[0]] = ratio;
}
/* src has center & dst has right => passthrough */
if (from_idx[1] != -1 && to_idx[2] != -1) {
if (from_idx[1] != -1 && to_idx[2] != -1 && from_idx[2] != -1) {
matrix[from_idx[1]][to_idx[2]] = 0.5 * ratio;
} else if (from_idx[1] != -1 && to_idx[2] != -1 && from_idx[2] == -1) {
matrix[from_idx[1]][to_idx[2]] = ratio;
}
}