[polypaudio-commits] r627 - /trunk/src/modules/alsa-util.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Sun Mar 5 10:35:46 PST 2006


Author: ossman
Date: Sun Mar  5 19:35:45 2006
New Revision: 627

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=627&root=polypaudio&view=rev
Log:
Return the proper error code so that we get a correct error message.

Modified:
    trunk/src/modules/alsa-util.c

Modified: trunk/src/modules/alsa-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/modules/alsa-util.c?rev=627&root=polypaudio&r1=626&r2=627&view=diff
==============================================================================
--- trunk/src/modules/alsa-util.c (original)
+++ trunk/src/modules/alsa-util.c Sun Mar  5 19:35:45 2006
@@ -263,25 +263,25 @@
     };
     assert(pcm_handle && ss && periods && period_size);
     
-    if (snd_pcm_hw_params_malloc(&hwparams) < 0 ||
-        snd_pcm_hw_params_any(pcm_handle, hwparams) < 0 ||
-        snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED) < 0 ||
-        snd_pcm_hw_params_set_format(pcm_handle, hwparams, format_trans[ss->format]) < 0 ||
-        snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &r, NULL) < 0 ||
-        snd_pcm_hw_params_set_channels(pcm_handle, hwparams, ss->channels) < 0 ||
-        (*periods > 0 && snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, periods, NULL) < 0) || 
-        (*period_size > 0 && snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, period_size, NULL) < 0) || 
-        snd_pcm_hw_params(pcm_handle, hwparams) < 0)
+    if ((ret = snd_pcm_hw_params_malloc(&hwparams)) < 0 ||
+        (ret = snd_pcm_hw_params_any(pcm_handle, hwparams)) < 0 ||
+    	(ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0 ||
+        (ret = snd_pcm_hw_params_set_format(pcm_handle, hwparams, format_trans[ss->format])) < 0 ||
+    	(ret = snd_pcm_hw_params_set_rate_near(pcm_handle, hwparams, &r, NULL)) < 0 ||
+        (ret = snd_pcm_hw_params_set_channels(pcm_handle, hwparams, ss->channels)) < 0 ||
+        (*periods > 0 && (ret = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, periods, NULL)) < 0) ||
+        (*period_size > 0 && (ret = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, period_size, NULL)) < 0) ||
+        (ret = snd_pcm_hw_params(pcm_handle, hwparams)) < 0)
         goto finish;
 
     if (ss->rate != r) 
         pa_log_info(__FILE__": device doesn't support %u Hz, changed to %u Hz.", ss->rate, r);
     
-    if (snd_pcm_prepare(pcm_handle) < 0)
+    if ((ret = snd_pcm_prepare(pcm_handle)) < 0)
         goto finish;
 
-    if (snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size) < 0 ||
-        snd_pcm_hw_params_get_period_size(hwparams, period_size, NULL) < 0)
+    if ((ret = snd_pcm_hw_params_get_buffer_size(hwparams, &buffer_size)) < 0 ||
+        (ret = snd_pcm_hw_params_get_period_size(hwparams, period_size, NULL)) < 0)
         goto finish;
     
     assert(buffer_size > 0);




More information about the pulseaudio-commits mailing list