[pulseaudio-commits] r1950 - /branches/lennart/src/modules/alsa-util.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Wed Oct 24 06:30:48 PDT 2007


Author: lennart
Date: Wed Oct 24 15:30:47 2007
New Revision: 1950

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1950&root=pulseaudio&view=rev
Log:
fix alsa mmap initialization bogosity, discovered by Jyri Sarha

Modified:
    branches/lennart/src/modules/alsa-util.c

Modified: branches/lennart/src/modules/alsa-util.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/branches/lennart/src/modules/alsa-util.c?rev=1950&root=pulseaudio&r1=1949&r2=1950&view=diff
==============================================================================
--- branches/lennart/src/modules/alsa-util.c (original)
+++ branches/lennart/src/modules/alsa-util.c Wed Oct 24 15:30:47 2007
@@ -298,14 +298,19 @@
         goto finish;
 
     if (use_mmap && *use_mmap) {
-        if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0)
+        if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_MMAP_INTERLEAVED)) < 0) {
+
+            /* mmap() didn't work, fall back to interleaved */
+
             if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
                 goto finish;
 
+            if (use_mmap)
+                *use_mmap = 0;
+        }
+
     } else if ((ret = snd_pcm_hw_params_set_access(pcm_handle, hwparams, SND_PCM_ACCESS_RW_INTERLEAVED)) < 0)
         goto finish;
-    else if (*use_mmap)
-        *use_mmap = 0;
 
     if ((ret = set_format(pcm_handle, hwparams, &f)) < 0)
         goto finish;




More information about the pulseaudio-commits mailing list