audio-converter: In passthrough, also don't copy if in and out block are the same

In and out array are usually different, they are stack allocated arrays.
However the blocks inside them still can be the same.

https://bugzilla.gnome.org/show_bug.cgi?id=775369
This commit is contained in:
Sebastian Dröge 2016-11-30 10:43:50 +02:00
parent 1631a38640
commit 71e819ae7d

View file

@ -851,8 +851,14 @@ converter_passthrough (GstAudioConverter * convert,
bytes = samples * (convert->in.bpf / convert->in.channels); bytes = samples * (convert->in.bpf / convert->in.channels);
for (i = 0; i < chain->blocks; i++) for (i = 0; i < chain->blocks; i++) {
if (out[i] == in[i]) {
g_assert (convert->in_place);
continue;
}
memcpy (out[i], in[i], bytes); memcpy (out[i], in[i], bytes);
}
} else { } else {
for (i = 0; i < chain->blocks; i++) for (i = 0; i < chain->blocks; i++)
gst_audio_format_fill_silence (convert->in.finfo, out[i], samples); gst_audio_format_fill_silence (convert->in.finfo, out[i], samples);