audiotestsrc: Initialize all samples in wave=ticks mode
authorSebastian Dröge <sebastian@centricular.com>
Sat, 22 Apr 2023 08:42:36 +0000 (11:42 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 22 Apr 2023 11:31:31 +0000 (12:31 +0100)
Previously samples were only initialized in 2 out of 3 cases.

Probably fixes https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/issues/337

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4476>

subprojects/gst-plugins-base/gst/audiotestsrc/gstaudiotestsrc.c

index a15fe5b..27707b5 100644 (file)
@@ -953,6 +953,10 @@ gst_audio_test_src_create_tick_##type (GstAudioTestSrc * src, g##type * samples)
       src->accumulator = 0; \
       src->tick_counter++; \
       volscale = calc_scaled_tick_volume (src, scale); \
+      for (c = 0; c < channels; ++c) { \
+        *ptr = 0; \
+        ptr += channel_step; \
+      } \
     } else if (samplemod < num_nonzero_samples)  { \
       gdouble ramp; \
       if (num_ramp_samples > 0) { \