From 1916eecc3059476897a42d9a614f52d595e0b3ca Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Wed, 25 May 2011 14:28:18 +0300 Subject: [PATCH] volume: use a flag for 'mute' using the controller Previously we checked mute_csource to determine wheter we need to premultiply volumes and mute values. That fails as we unrefs mute_csource and set it to NULL after. Use an extra flag instead. --- gst/volume/gstvolume.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gst/volume/gstvolume.c b/gst/volume/gstvolume.c index a592707..03145bf 100644 --- a/gst/volume/gstvolume.c +++ b/gst/volume/gstvolume.c @@ -897,6 +897,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) guint nsamples = size / (width * channels); GstClockTime interval = gst_util_uint64_scale_int (1, GST_SECOND, rate); GstClockTime ts = GST_BUFFER_TIMESTAMP (outbuf); + gboolean use_mutes = FALSE; ts = gst_segment_to_stream_time (&base->segment, GST_FORMAT_TIME, ts); @@ -918,6 +919,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) gst_object_unref (mute_csource); mute_csource = NULL; + use_mutes = TRUE; } else { g_free (self->mutes); self->mutes = NULL; @@ -937,7 +939,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf) orc_memset_f64 (self->volumes, self->current_volume, nsamples); } - if (mute_csource) { + if (use_mutes) { orc_prepare_volumes (self->volumes, self->mutes, nsamples); } -- 2.7.4