changeset 34763:6834d78ac904

Clarify the used opening modes by improving the verbose status messages. By now, the (only) message indicates that the device is always opened in blocking mode, regardless of the "block" suboption to the ALSA output driver.
author ib
date Tue, 10 Apr 2012 13:17:49 +0000
parents c1db6548917e
children 9e81d9667789
files libao2/ao_alsa.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libao2/ao_alsa.c	Mon Apr 09 11:25:57 2012 +0000
+++ b/libao2/ao_alsa.c	Tue Apr 10 13:17:49 2012 +0000
@@ -463,6 +463,7 @@
       int open_mode = block ? 0 : SND_PCM_NONBLOCK;
       int isac3 =  AF_FORMAT_IS_AC3(format) || AF_FORMAT_IS_IEC61937(format);
       //modes = 0, SND_PCM_NONBLOCK, SND_PCM_ASYNC
+      mp_msg(MSGT_AO,MSGL_V,"alsa-init: opening device in %sblocking mode\n", block ? "" : "non-");
       if ((err = try_open_device(alsa_device, open_mode, isac3)) < 0)
 	{
 	  if (err != -EBUSY && !block) {
@@ -480,7 +481,7 @@
       if ((err = snd_pcm_nonblock(alsa_handler, 0)) < 0) {
          mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ErrorSetBlockMode, snd_strerror(err));
       } else {
-	mp_msg(MSGT_AO,MSGL_V,"alsa-init: pcm opened in blocking mode\n");
+	mp_msg(MSGT_AO,MSGL_V,"alsa-init: device reopened in blocking mode\n");
       }
 
       snd_pcm_hw_params_alloca(&alsa_hwparams);