[vlc-devel] commit: Fix video delay when using alsa or oss as slaves ( Antoine Cellerier )

git version control git at videolan.org
Sat Jul 18 19:09:29 CEST 2009


vlc | branch: 1.0-bugfix | Antoine Cellerier <dionoea at videolan.org> | Fri Jul 17 14:57:00 2009 +0200| [3ef9901ec1eff3f0b3c8026629508400a001978a] | committer: Antoine Cellerier 

Fix video delay when using alsa or oss as slaves

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.
(cherry picked from commit 3d9fc4219740a4f826c77d37db4ed2688c5ef73d)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3ef9901ec1eff3f0b3c8026629508400a001978a
---

 modules/access/alsa.c |    2 +-
 modules/access/oss.c  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/modules/access/alsa.c b/modules/access/alsa.c
index 43bd16f..b71a304 100644
--- a/modules/access/alsa.c
+++ b/modules/access/alsa.c
@@ -318,7 +318,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:
diff --git a/modules/access/oss.c b/modules/access/oss.c
index 7ea6527..eb0d624 100644
--- a/modules/access/oss.c
+++ b/modules/access/oss.c
@@ -273,7 +273,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) )
             {




More information about the vlc-devel mailing list