mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +00:00
audiomixer: The pad's size is always supposed to be the whole buffer size
And the offset the offset into that buffer. Changing the size will cause all kinds of assumptions to fail and cause crashes.
This commit is contained in:
parent
06f6d3c65c
commit
eff64c7ddc
1 changed files with 2 additions and 3 deletions
|
@ -1114,10 +1114,9 @@ gst_audio_mixer_fill_buffer (GstAudioMixer * audiomixer, GstAudioMixerPad * pad,
|
||||||
if (start_running_time_offset < audiomixer->offset) {
|
if (start_running_time_offset < audiomixer->offset) {
|
||||||
GstBuffer *buf;
|
GstBuffer *buf;
|
||||||
guint diff = (audiomixer->offset - start_running_time_offset) * bpf;
|
guint diff = (audiomixer->offset - start_running_time_offset) * bpf;
|
||||||
|
|
||||||
pad->position += diff;
|
pad->position += diff;
|
||||||
pad->size -= diff;
|
if (pad->position >= pad->size) {
|
||||||
/* FIXME: This could only happen due to rounding errors */
|
|
||||||
if (pad->size == 0) {
|
|
||||||
/* Empty buffer, drop */
|
/* Empty buffer, drop */
|
||||||
gst_buffer_unref (inbuf);
|
gst_buffer_unref (inbuf);
|
||||||
pad->buffer = NULL;
|
pad->buffer = NULL;
|
||||||
|
|
Loading…
Reference in a new issue