From ee15c8fd1f3c8c0d085b0e6d1145cf1447bc34e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 16 Jan 2014 12:18:45 +0100 Subject: [PATCH] audiomixer: Remove some useless assignments and skip the current part of the buffer if the pad is muted --- gst/audiomixer/gstaudiomixer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gst/audiomixer/gstaudiomixer.c b/gst/audiomixer/gstaudiomixer.c index 5929851064..f604ce7433 100644 --- a/gst/audiomixer/gstaudiomixer.c +++ b/gst/audiomixer/gstaudiomixer.c @@ -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);