volume: Do not try to get binding value array if we are not processing any sample
authorThibault Saunier <tsaunier@gnome.org>
Thu, 5 Nov 2015 10:34:07 +0000 (11:34 +0100)
committerThibault Saunier <tsaunier@gnome.org>
Thu, 5 Nov 2015 10:44:31 +0000 (11:44 +0100)
In some conditions we might process empty buffers, calling
gst_control_binding_get_value_array in that case will lead
to the assertion:

  (lt-ges-launch-1.0:18859): GStreamer-CRITICAL **: gst_control_binding_get_value_array: assertion 'values' failed

gst/volume/gstvolume.c

index 0b6482a..d439e9b 100644 (file)
@@ -760,7 +760,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
         self->volumes_count = nsamples;
       }
 
-      if (volume_cb) {
+      if (volume_cb && self->volumes) {
         have_volumes =
             gst_control_binding_get_value_array (volume_cb, ts, interval,
             nsamples, (gpointer) self->volumes);
@@ -770,7 +770,7 @@ volume_transform_ip (GstBaseTransform * base, GstBuffer * outbuf)
         volume_orc_memset_f64 (self->volumes, self->current_volume, nsamples);
       }
 
-      if (mute_cb) {
+      if (mute_cb && self->mutes) {
         have_mutes = gst_control_binding_get_value_array (mute_cb, ts, interval,
             nsamples, (gpointer) self->mutes);
         gst_object_replace ((GstObject **) & mute_cb, NULL);