[vlc-commits] ALSA: log the device string that is actually opened

Rémi Denis-Courmont git at videolan.org
Mon Mar 16 19:05:17 CET 2015


vlc/vlc-2.2 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Mar 16 20:04:33 2015 +0200| [22dea4b7368bf653c9d6f9e8079d9dcf9896c8e6] | committer: Rémi Denis-Courmont

ALSA: log the device string that is actually opened

(cherry picked from commit 45db0215add18231b00e3ebdf7762a0e68da5b2a)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.2.git/?a=commit;h=22dea4b7368bf653c9d6f9e8079d9dcf9896c8e6
---

 modules/audio_output/alsa.c |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/audio_output/alsa.c b/modules/audio_output/alsa.c
index 9e0fe10..fd40d85 100644
--- a/modules/audio_output/alsa.c
+++ b/modules/audio_output/alsa.c
@@ -382,20 +382,21 @@ static int Start (audio_output_t *aout, audio_sample_format_t *restrict fmt)
     const int mode = SND_PCM_NO_AUTO_RESAMPLE;
 
     int val = snd_pcm_open (&pcm, device, SND_PCM_STREAM_PLAYBACK, mode);
-    free (devbuf);
     if (val != 0)
     {
-        msg_Err (aout, "cannot open ALSA device \"%s\": %s", sys->device,
+        msg_Err (aout, "cannot open ALSA device \"%s\": %s", device,
                  snd_strerror (val));
         dialog_Fatal (aout, _("Audio output failed"),
                       _("The audio device \"%s\" could not be used:\n%s."),
                       sys->device, snd_strerror (val));
+        free (devbuf);
         return VLC_EGENERIC;
     }
     sys->pcm = pcm;
 
     /* Print some potentially useful debug */
-    msg_Dbg (aout, "using ALSA device: %s", sys->device);
+    msg_Dbg (aout, "using ALSA device: %s", device);
+    free (devbuf);
     DumpDevice (VLC_OBJECT(aout), pcm);
 
     /* Get Initial hardware parameters */



More information about the vlc-commits mailing list