Fixed segtotal value being always 2 due to an unused variable

The 'MAX' expression used to set segtotal always returned 2 because the unused and unitialized variable buffer_frame_count was always 0
This commit is contained in:
Marcos Kintschner 2019-04-30 21:25:12 -03:00
parent 3a0a82a783
commit dd7839ca43
2 changed files with 1 additions and 3 deletions

View 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);

View 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 */