audiomixer: Only advance by the buffer size when a buffer is late

https://bugzilla.gnome.org/show_bug.cgi?id=745768
This commit is contained in:
Olivier Crête 2015-03-06 20:25:03 -05:00
parent 25d8f76ecd
commit 3f59bc95b8

View file

@ -1465,11 +1465,9 @@ gst_audiomixer_aggregate (GstAggregator * agg, gboolean timeout)
gint64 diff = audiomixer->offset - pad->output_offset;
gint bpf = GST_AUDIO_INFO_BPF (&audiomixer->info);
if (pad->position + (diff * bpf) > pad->size)
diff = (pad->size - pad->position) / bpf;
pad->position += diff * bpf;
if (pad->position > pad->size) {
diff = (pad->position - pad->size) / bpf;
pad->position = pad->size;
}
pad->output_offset += diff;
if (pad->position == pad->size) {