From dd7839ca43841553ebb7682485b413c429f01337 Mon Sep 17 00:00:00 2001 From: Marcos Kintschner Date: Tue, 30 Apr 2019 21:25:12 -0300 Subject: [PATCH] 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 --- sys/wasapi/gstwasapisrc.c | 2 +- sys/wasapi/gstwasapisrc.h | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/sys/wasapi/gstwasapisrc.c b/sys/wasapi/gstwasapisrc.c index a14ed4a019..3bb8b3f842 100644 --- a/sys/wasapi/gstwasapisrc.c +++ b/sys/wasapi/gstwasapisrc.c @@ -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); diff --git a/sys/wasapi/gstwasapisrc.h b/sys/wasapi/gstwasapisrc.h index 60d7b4a2f0..3811ab9746 100644 --- a/sys/wasapi/gstwasapisrc.h +++ b/sys/wasapi/gstwasapisrc.h @@ -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 */