Commit 8e3e302d authored by Gildas Bazin's avatar Gildas Bazin

* src/playlist/playlist.c: fixed deadlock in playlist.
* modules/audio_output/oss.c: don't play blank samples when we are starving
   for data but our internal buffers are not empty. Some cleanup too.
parent 1fdc92cb
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* oss.c : OSS /dev/dsp module for vlc * oss.c : OSS /dev/dsp module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2002 VideoLAN * Copyright (C) 2000-2002 VideoLAN
* $Id: oss.c,v 1.33 2002/11/14 22:38:47 massiot Exp $ * $Id: oss.c,v 1.34 2002/11/21 15:51:57 gbazin Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -540,21 +540,21 @@ static int OSSThread( aout_instance_t * p_aout ) ...@@ -540,21 +540,21 @@ static int OSSThread( aout_instance_t * p_aout )
#undef i_fragstotal #undef i_fragstotal
} }
if( !next_date ) /* Next buffer will be played at mdate() + buffered */
{ p_buffer = aout_OutputNextBuffer( p_aout, mdate() + buffered,
/* This is the _real_ presentation date */ VLC_FALSE );
next_date = mdate() + buffered;
} if( p_buffer == NULL &&
else buffered > ( p_aout->output.p_sys->max_buffer_duration
/ p_aout->output.p_sys->i_fragstotal ) )
{ {
/* Give a hint to the audio output about our drift, but /* If we have at least a fragment full, then we can wait a
* not too much because we want to make it happy with our * little and retry to get a new audio buffer instead of
* nicely calculated dates. */ * playing a blank sample */
next_date = ( (next_date * 7) + (mdate() + buffered) ) / 8; msleep( ( p_aout->output.p_sys->max_buffer_duration
/ p_aout->output.p_sys->i_fragstotal / 2 ) );
continue;
} }
/* Next buffer will be played at mdate()+buffered */
p_buffer = aout_OutputNextBuffer( p_aout, next_date, VLC_FALSE );
} }
else else
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.c : Playlist management functions * playlist.c : Playlist management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: playlist.c,v 1.22 2002/11/18 13:08:35 gbazin Exp $ * $Id: playlist.c,v 1.23 2002/11/21 15:51:57 gbazin Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -322,7 +322,9 @@ static void RunThread ( playlist_t *p_playlist ) ...@@ -322,7 +322,9 @@ static void RunThread ( playlist_t *p_playlist )
/* Check for autodeletion */ /* Check for autodeletion */
if( p_playlist->pp_items[p_playlist->i_index]->b_autodeletion ) if( p_playlist->pp_items[p_playlist->i_index]->b_autodeletion )
{ {
vlc_mutex_unlock( &p_playlist->object_lock );
playlist_Delete( p_playlist, p_playlist->i_index ); playlist_Delete( p_playlist, p_playlist->i_index );
vlc_mutex_lock( &p_playlist->object_lock );
} }
/* Select the next playlist item */ /* Select the next playlist item */
......
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