* oss.c : OSS /dev/dsp module for vlc
*****************************************************************************
* 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>
* Samuel Hocevar <sam@zoy.org>
free( p_sys );
return VLC_EGENERIC;
}
- else
+ else
{
/* Number of fragments actually allocated */
p_aout->output.p_sys->i_fragstotal = audio_buf.fragstotal;
#undef i_fragstotal
}
- if( !next_date )
- {
- /* This is the _real_ presentation date */
- next_date = mdate() + buffered;
- }
- else
+ /* Next buffer will be played at mdate() + buffered */
+ p_buffer = aout_OutputNextBuffer( p_aout, mdate() + buffered,
+ VLC_FALSE );
+
+ if( p_buffer == NULL &&
+ 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
- * not too much because we want to make it happy with our
- * nicely calculated dates. */
- next_date = ( (next_date * 7) + (mdate() + buffered) ) / 8;
+ /* If we have at least a fragment full, then we can wait a
+ * little and retry to get a new audio buffer instead of
+ * playing a blank sample */
+ 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
{
* playlist.c : Playlist management functions
*****************************************************************************
* 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>
*
/* Check for 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 );
+ vlc_mutex_lock( &p_playlist->object_lock );
}
/* Select the next playlist item */