Commit f529041b authored by Jon Lech Johansen's avatar Jon Lech Johansen

Another attempt at fixing the soundstick issue (unconfirmed).

parent bef1dece
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout.m: CoreAudio output plugin * aout.m: CoreAudio output plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: aout.m,v 1.27 2003/03/15 19:21:49 jlj Exp $ * $Id: aout.m,v 1.28 2003/03/15 22:10:58 jlj Exp $
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Colin Delacroix <colin@zoy.org>
* Jon Lech Johansen <jon-vl@nanocrew.net> * Jon Lech Johansen <jon-vl@nanocrew.net>
...@@ -1161,6 +1161,8 @@ static int InitDevice( aout_instance_t * p_aout ) ...@@ -1161,6 +1161,8 @@ static int InitDevice( aout_instance_t * p_aout )
if( memcmp( &P_STREAMS[i_stream], &p_sys->sfmt_revert, if( memcmp( &P_STREAMS[i_stream], &p_sys->sfmt_revert,
sizeof( p_sys->sfmt_revert ) ) != 0 ) sizeof( p_sys->sfmt_revert ) ) != 0 )
{ {
struct timeval now;
struct timespec timeout;
struct { vlc_mutex_t lock; vlc_cond_t cond; } w; struct { vlc_mutex_t lock; vlc_cond_t cond; } w;
vlc_cond_init( p_aout, &w.cond ); vlc_cond_init( p_aout, &w.cond );
...@@ -1200,17 +1202,20 @@ static int InitDevice( aout_instance_t * p_aout ) ...@@ -1200,17 +1202,20 @@ static int InitDevice( aout_instance_t * p_aout )
return( VLC_EGENERIC ); return( VLC_EGENERIC );
} }
vlc_cond_wait( &w.cond, &w.lock ); gettimeofday( &now, NULL );
vlc_mutex_unlock( &w.lock ); timeout.tv_sec = now.tv_sec;
timeout.tv_nsec = (now.tv_usec + 100000) * 1000;
vlc_mutex_destroy( &w.lock ); pthread_cond_timedwait( &w.cond.cond, &w.lock.mutex, &timeout );
vlc_cond_destroy( &w.cond ); vlc_mutex_unlock( &w.lock );
if( GetStreamID( p_dev->devid, p_option->i_idx + 1, if( GetStreamID( p_dev->devid, p_option->i_idx + 1,
&p_option->i_sid ) ) &p_option->i_sid ) )
{ {
msg_Err( p_aout, "GetStreamID(%ld, %ld) failed", msg_Err( p_aout, "GetStreamID(%ld, %ld) failed",
p_option->i_dev, p_option->i_idx ); p_option->i_dev, p_option->i_idx );
vlc_mutex_destroy( &w.lock );
vlc_cond_destroy( &w.cond );
return( VLC_EGENERIC ); return( VLC_EGENERIC );
} }
...@@ -1221,10 +1226,14 @@ static int InitDevice( aout_instance_t * p_aout ) ...@@ -1221,10 +1226,14 @@ static int InitDevice( aout_instance_t * p_aout )
msg_Err( p_aout, msg_Err( p_aout,
"AudioStreamRemovePropertyListener failed: [%4.4s]", "AudioStreamRemovePropertyListener failed: [%4.4s]",
(char *)&err ); (char *)&err );
vlc_mutex_destroy( &w.lock );
vlc_cond_destroy( &w.cond );
return( VLC_EGENERIC ); return( VLC_EGENERIC );
} }
vlc_mutex_destroy( &w.lock );
vlc_cond_destroy( &w.cond );
p_sys->b_revert_sfmt = VLC_TRUE; p_sys->b_revert_sfmt = VLC_TRUE;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment