Commit 7b90bf32 authored by Sebastian Dröge's avatar Sebastian Dröge
Browse files

level: Don't read over the end of the input memory

Previously we advanced the in_data pointer by bps for every channel, and then
later again for block_size*bps. This caused us to be one sample further than
expected if an input buffer covered two analysis frames. And in the end lead
to completely bogus values reported by level.
parent c809bcd3
......@@ -624,7 +624,7 @@ gst_level_transform_ip (GstBaseTransform * trans, GstBuffer * in)
for (i = 0; i < channels; ++i) {
filter->process (in_data, block_int_size, channels, &CS,
filter->process (in_data + (bps * i), block_int_size, channels, &CS,
"[%d]: cumulative squares %lf, over %d samples/%d channels",
......@@ -633,7 +633,6 @@ gst_level_transform_ip (GstBaseTransform * trans, GstBuffer * in)
} else {
filter->peak[i] = 0.0;
in_data += bps;
filter->decay_peak_age[i] += GST_FRAMES_TO_CLOCK_TIME (num_frames, rate);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment