]> git.sesse.net Git - vlc/commitdiff
Fix video delay when using alsa or oss as slaves
authorAntoine Cellerier <dionoea@videolan.org>
Fri, 17 Jul 2009 12:57:00 +0000 (14:57 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Fri, 17 Jul 2009 12:57:00 +0000 (14:57 +0200)
Decrease poll delay from 0.5 to 0.01 seconds in alsa in oss, else the
audio input would block the video input when used as an input slave.
Other accesses likely to be used as input slaves might need to be
changed. An easier solution (module-wise, harder core wise) would be to
run each slave in its own thread.

modules/access/alsa.c
modules/access/oss.c

index 69b7e7fde31a359749187b743dd90a1e9e30a09e..67b5afa5d062242d7a27509a24e10b27551d769a 100644 (file)
@@ -312,7 +312,7 @@ static int Demux( demux_t *p_demux )
         }
 
         /* Wait for data */
-        int i_wait = snd_pcm_wait( p_sys->p_alsa_pcm, 500 );
+        int i_wait = snd_pcm_wait( p_sys->p_alsa_pcm, 10 ); /* See poll() comment in oss.c */
         switch( i_wait )
         {
             case 1:
index 4d8c746d52033c2a807ae4b883049a23bf118314..7ef664d574f09623f171e61aff2543f88ce9f612 100644 (file)
@@ -272,7 +272,7 @@ static int Demux( demux_t *p_demux )
         }
 
         /* Wait for data */
-        if( poll( &fd, 1, 500 ) ) /* Timeout after 0.5 seconds since I don't know if pf_demux can be blocking. */
+        if( poll( &fd, 1, 10 ) ) /* Timeout after 0.01 seconds. Bigger delays are an issue when used with/as an input-slave since all the inputs run in the same thread. */
         {
             if( fd.revents & (POLLIN|POLLPRI) )
             {