Commit dfd23a31 authored by Sebastian Dröge's avatar Sebastian Dröge 🍵

audiomixer: Remove some useless assignments and skip the current part of the...

audiomixer: Remove some useless assignments and skip the current part of the buffer if the pad is muted
parent 9d31536a
......@@ -1435,12 +1435,10 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstCollectPads * pads,
if (pad->mute || pad->volume < G_MINDOUBLE) {
GST_DEBUG_OBJECT (pad, "Skipping muted pad");
gst_buffer_unref (inbuf);
adata->position += adata->size;
adata->output_offset += adata->size / bpf;
adata->position += overlap * bpf;
adata->output_offset += overlap;
if (adata->position >= adata->size) {
/* Buffer done, drop it */
adata->position = 0;
adata->size = 0;
gst_buffer_replace (&adata->buffer, NULL);
gst_buffer_unref (gst_collect_pads_pop (pads, collect_data));
}
......@@ -1452,7 +1450,6 @@ gst_audio_mixer_mix_buffer (GstAudioMixer * audiomixer, GstCollectPads * pads,
/* skip gap buffer */
GST_LOG_OBJECT (pad, "skipping GAP buffer");
gst_buffer_unref (inbuf);
adata->position += adata->size;
adata->output_offset += adata->size / bpf;
/* Buffer done, drop it */
gst_buffer_replace (&adata->buffer, NULL);
......
Markdown is supported
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