mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 06:46:38 +00:00
spectrum: use local var for input_data function
Avoid dereferencing the input_data from the instance from within an inner loop.
This commit is contained in:
parent
85ace6d413
commit
1979b04f46
1 changed files with 5 additions and 2 deletions
|
@ -974,12 +974,14 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
|
|||
input_pos = spectrum->input_pos;
|
||||
|
||||
if (!spectrum->multi_channel) {
|
||||
GstSpectrumInputDataMixed input_data_mixed = spectrum->input_data_mixed;
|
||||
|
||||
cd = &spectrum->channel_data[0];
|
||||
input = cd->input;
|
||||
|
||||
while (size >= width * channels) {
|
||||
/* Move the mixdown of current frame into our ringbuffer */
|
||||
input[input_pos] = spectrum->input_data_mixed (data, channels, max_value);
|
||||
input[input_pos] = input_data_mixed (data, channels, max_value);
|
||||
|
||||
data += width * channels;
|
||||
size -= width * channels;
|
||||
|
@ -1035,13 +1037,14 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * buffer)
|
|||
}
|
||||
} else {
|
||||
guint c;
|
||||
GstSpectrumInputData input_data = spectrum->input_data;
|
||||
|
||||
while (size >= width * channels) {
|
||||
for (c = 0; c < channels; c++) {
|
||||
cd = &spectrum->channel_data[c];
|
||||
input = cd->input;
|
||||
/* Move the current frames into our ringbuffers */
|
||||
input[input_pos] = spectrum->input_data (data, max_value);
|
||||
input[input_pos] = input_data (data, max_value);
|
||||
data += width;
|
||||
}
|
||||
size -= width * channels;
|
||||
|
|
Loading…
Reference in a new issue