]> Repos - portaudio/commitdiff
alsa: init stream variable in pa_linux_alsa.c (#584)
authorPhil Burk <philburk@mobileer.com>
Wed, 9 Jun 2021 00:19:44 +0000 (17:19 -0700)
committerGitHub <noreply@github.com>
Wed, 9 Jun 2021 00:19:44 +0000 (17:19 -0700)
Prevent compiler warnings.

Alternative to #567

src/hostapi/alsa/pa_linux_alsa.c

index a6d2aec9c51134f633e7c77e5e969db7c5ffa4c3..cf01f47eea40610c414b324fd73d346aabb06b09 100644 (file)
@@ -4635,6 +4635,7 @@ PaError PaAlsa_GetStreamInputCard( PaStream* s, int* card )
     PaError result = paNoError;
     snd_pcm_info_t* pcmInfo;
 
+    stream = NULL;
     PA_ENSURE( GetAlsaStreamPointer( s, &stream ) );
 
     /* XXX: More descriptive error? */
@@ -4654,6 +4655,7 @@ PaError PaAlsa_GetStreamOutputCard( PaStream* s, int* card )
     PaError result = paNoError;
     snd_pcm_info_t* pcmInfo;
 
+    stream = NULL;
     PA_ENSURE( GetAlsaStreamPointer( s, &stream ) );
 
     /* XXX: More descriptive error? */