]> git.sesse.net Git - vlc/commitdiff
alsa: sets period size before buffer size, patch by Matthias P. Nowak
authorRafaël Carré <funman@videolan.org>
Fri, 18 Jan 2008 14:56:56 +0000 (14:56 +0000)
committerRafaël Carré <funman@videolan.org>
Fri, 18 Jan 2008 14:56:56 +0000 (14:56 +0000)
THANKS
modules/audio_output/alsa.c

diff --git a/THANKS b/THANKS
index 491c62022acfa9071d28a5627c2a0d8937985307..ee3efe87499d9969943db8615f8c131c4b3ad0c8 100644 (file)
--- a/THANKS
+++ b/THANKS
@@ -148,6 +148,7 @@ Mateus Krepsky Ludwich <mateus @t csp dot com d.t br> - rc interface mosaic-orde
 Mathias C. Berens | welcome-soft <berens at welcome-soft.de> - German translation
 Mathias Kretschmer <mathias at research.att.com> - IP Multicast support
 Mats Rojestal <mats.rojestal at bredband dot net> - compilation fixes for Solaris 9
+Matthias P. Nowak <mpnowak at broadpark dot no> - ALSA 5.1 fix
 Matthieu Lochegnies <prof at tocard dot org> - MPEG audio emphasis fix
 Max Rudberg <max_08 at mac.com> - Mac OS X controller art (v0.7.0)
 Meelad Zakaria <meelad at farsiweb dot info> - Persian localisation
index c78566cfc4669b2c4fade4d42ff5e49e660a2602..dbcb02bc1a6b01d71961a844e3222e84d9811216 100644 (file)
@@ -585,34 +585,34 @@ static int Open( vlc_object_t *p_this )
                 p_aout->output.output.i_rate );
         }
 
-        /* Set buffer size. */
+        /* Set period size. */
 #ifdef HAVE_ALSA_NEW_API
-        if ( ( i_snd_rc = snd_pcm_hw_params_set_buffer_size_near( p_sys->p_snd_pcm,
-                                    p_hw, &i_buffer_size ) ) < 0 )
+        if ( ( i_snd_rc = snd_pcm_hw_params_set_period_size_near( p_sys->p_snd_pcm,
+                                    p_hw, &i_period_size, NULL ) ) < 0 )
 #else
-        if ( ( i_snd_rc = snd_pcm_hw_params_set_buffer_size_near( p_sys->p_snd_pcm,
-                                    p_hw, i_buffer_size ) ) < 0 )
+        if ( ( i_snd_rc = snd_pcm_hw_params_set_period_size_near( p_sys->p_snd_pcm,
+                                    p_hw, i_period_size, NULL ) ) < 0 )
 #endif
         {
-            msg_Err( p_aout, "unable to set buffer size (%s)",
+            msg_Err( p_aout, "unable to set period size (%s)",
                          snd_strerror( i_snd_rc ) );
             goto error;
         }
+        p_aout->output.i_nb_samples = i_period_size;
 
-        /* Set period size. */
+/* Set buffer size. */
 #ifdef HAVE_ALSA_NEW_API
-        if ( ( i_snd_rc = snd_pcm_hw_params_set_period_size_near( p_sys->p_snd_pcm,
-                                    p_hw, &i_period_size, NULL ) ) < 0 )
+        if ( ( i_snd_rc = snd_pcm_hw_params_set_buffer_size_near( p_sys->p_snd_pcm,
+                                    p_hw, &i_buffer_size ) ) < 0 )
 #else
-        if ( ( i_snd_rc = snd_pcm_hw_params_set_period_size_near( p_sys->p_snd_pcm,
-                                    p_hw, i_period_size, NULL ) ) < 0 )
+        if ( ( i_snd_rc = snd_pcm_hw_params_set_buffer_size_near( p_sys->p_snd_pcm,
+                                    p_hw, i_buffer_size ) ) < 0 )
 #endif
         {
-            msg_Err( p_aout, "unable to set period size (%s)",
+            msg_Err( p_aout, "unable to set buffer size (%s)",
                          snd_strerror( i_snd_rc ) );
             goto error;
         }
-        p_aout->output.i_nb_samples = i_period_size;
 
         /* Commit hardware parameters. */
         if ( ( i_snd_rc = snd_pcm_hw_params( p_sys->p_snd_pcm, p_hw ) ) < 0 )