Commit 95efa086 authored by Gildas Bazin's avatar Gildas Bazin

* src/audio_output/common.c, include/aout_internal.h: added a new function
   aout_FifoFirstDate() that allows the aout plugin to schedule the first
   play.
* src/audio_output/output.c: fixed another problem affecting the audio quality.
* modules/audio_output/directx.c: improvements. The buffering scheme has been
   changed to be less affected by temporary starving. We also schedule the first   sample to play.
parent c40d4552
......@@ -2,7 +2,7 @@
* aout_internal.h : internal defines for audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout_internal.h,v 1.26 2002/10/25 15:42:00 gbazin Exp $
* $Id: aout_internal.h,v 1.27 2002/11/01 15:06:23 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -272,6 +272,7 @@ void aout_FifoSet( aout_instance_t *, aout_fifo_t *, mtime_t );
void aout_FifoMoveDates( aout_instance_t *, aout_fifo_t *, mtime_t );
VLC_EXPORT( aout_buffer_t *, aout_FifoPop, ( aout_instance_t * p_aout, aout_fifo_t * p_fifo ) );
void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo );
VLC_EXPORT( mtime_t, aout_FifoFirstDate, ( aout_instance_t *, aout_fifo_t * ) );
/* From intf.c :*/
VLC_EXPORT( void, aout_VolumeSoftInit, ( aout_instance_t * ) );
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
* common.c : audio output management of common data structures
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: common.c,v 1.5 2002/10/22 23:08:00 massiot Exp $
* $Id: common.c,v 1.6 2002/11/01 15:06:23 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -314,6 +314,16 @@ mtime_t aout_FifoNextStart( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
return aout_DateGet( &p_fifo->end_date );
}
/*****************************************************************************
* aout_FifoFirstDate : return the playing date of the first buffer in the
* FIFO
*****************************************************************************/
mtime_t aout_FifoFirstDate( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
{
return p_fifo->p_first ?
aout_DateGet( &p_fifo->p_first->start_date ) : 0;
}
/*****************************************************************************
* aout_FifoPop : get the next buffer out of the FIFO
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* output.c : internal management of output streams for the audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: output.c,v 1.20 2002/10/31 09:40:26 gbazin Exp $
* $Id: output.c,v 1.21 2002/11/01 15:06:23 gbazin Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -193,13 +193,20 @@ aout_buffer_t * aout_OutputNextBuffer( aout_instance_t * p_aout,
if ( p_buffer == NULL )
{
p_aout->output.fifo.pp_last = &p_aout->output.fifo.p_first;
#if 0 /* This is bad because the audio output might just be trying to fill
* in it's internal buffers. And anyway, it's up to the audio output
* to deal with this kind of starvation. */
/* Set date to 0, to allow the mixer to send a new buffer ASAP */
aout_FifoSet( p_aout, &p_aout->output.fifo, 0 );
vlc_mutex_unlock( &p_aout->output_fifo_lock );
if ( !p_aout->output.b_starving )
msg_Dbg( p_aout,
"audio output is starving (no input), playing silence" );
p_aout->output.b_starving = 1;
#endif
vlc_mutex_unlock( &p_aout->output_fifo_lock );
return NULL;
}
......
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