Fixed segtotal value being always 2 due to an unused variable
authorMarcos Kintschner <marcos.ktn@gmail.com>
Wed, 1 May 2019 00:25:12 +0000 (21:25 -0300)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 11 Aug 2019 11:32:12 +0000 (11:32 +0000)
The 'MAX' expression used to set segtotal always returned 2 because
the unused and uninitialized variable buffer_frame_count was always 0

sys/wasapi/gstwasapisrc.c
sys/wasapi/gstwasapisrc.h

index a14ed4a..3bb8b3f 100644 (file)
@@ -473,7 +473,7 @@ gst_wasapi_src_prepare (GstAudioSrc * asrc, GstAudioRingBufferSpec * spec)
   spec->segsize = devicep_frames * bpf;
 
   /* We need a minimum of 2 segments to ensure glitch-free playback */
-  spec->segtotal = MAX (self->buffer_frame_count * bpf / spec->segsize, 2);
+  spec->segtotal = MAX (buffer_frames * bpf / spec->segsize, 2);
 
   GST_INFO_OBJECT (self, "segsize is %i, segtotal is %i", spec->segsize,
       spec->segtotal);
index 60d7b4a..3811ab9 100644 (file)
@@ -49,8 +49,6 @@ struct _GstWasapiSrc
   /* Client was reset, so it needs to be started again */
   gboolean client_needs_restart;
 
-  /* Actual size of the allocated buffer */
-  guint buffer_frame_count;
   /* The mix format that wasapi prefers in shared mode */
   WAVEFORMATEX *mix_format;
   /* The probed caps that we can accept */