Commit 2a6648ee authored by Gildas Bazin's avatar Gildas Bazin

* src/audio_ouput/input.c: better on-the-fly switching of audio filters.

parent f5ed9a69
......@@ -2,7 +2,7 @@
* common.c : audio output management of common data structures
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
* $Id: common.c,v 1.19 2004/01/06 12:02:05 zorglub Exp $
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -401,6 +401,9 @@ void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
aout_BufferFree( p_buffer );
p_buffer = p_next;
}
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
}
......
......@@ -308,9 +308,21 @@ int aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
if( p_input->b_restart )
{
aout_fifo_t fifo, dummy_fifo;
int p_first_byte_to_mix;
vlc_mutex_lock( &p_aout->mixer_lock );
/* A little trick to avoid loosing our input fifo */
aout_FifoInit( p_aout, &dummy_fifo, p_aout->mixer.mixer.i_rate );
p_first_byte_to_mix = p_input->p_first_byte_to_mix;
fifo = p_input->fifo;
p_input->fifo = dummy_fifo;
aout_InputDelete( p_aout, p_input );
aout_InputNew( p_aout, p_input );
p_input->p_first_byte_to_mix = p_first_byte_to_mix;
p_input->fifo = fifo;
vlc_mutex_unlock( &p_aout->mixer_lock );
}
......
......@@ -2,7 +2,7 @@
* mixer.c : audio output mixing operations
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
* $Id: mixer.c,v 1.30 2004/03/03 20:39:52 gbazin Exp $
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -261,16 +261,14 @@ static int MixBuffer( aout_instance_t * p_aout )
{
p_input->p_first_byte_to_mix = p_buffer->p_buffer;
}
mixer_nb_bytes = p_input->p_first_byte_to_mix
- p_buffer->p_buffer;
mixer_nb_bytes = p_input->p_first_byte_to_mix - p_buffer->p_buffer;
if ( !((i_nb_bytes + p_aout->mixer.mixer.i_bytes_per_frame
> mixer_nb_bytes) &&
(i_nb_bytes < p_aout->mixer.mixer.i_bytes_per_frame
+ mixer_nb_bytes)) )
{
msg_Warn( p_aout,
"mixer start isn't output start ("I64Fd")",
msg_Warn( p_aout, "mixer start isn't output start ("I64Fd")",
i_nb_bytes - mixer_nb_bytes );
/* Round to the nearest multiple */
......
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