Commit 5ffbc97e authored by Christophe Massiot's avatar Christophe Massiot

* ./configure: Fixed double detection of gethostbyname.

* Major changes in the handling of dates in the audio output ; still buggy,
but differently.
* Fixed a major bug in the aout pre-filters, preventing to run any other
decoder than liba52.
* p_aout->output.pf_play now has only one argument.
parent 91b103c2
This diff is collapsed.
......@@ -147,10 +147,8 @@ AC_CHECK_FUNC(send,,[
http_LDFLAGS="${http_LDFLAGS} -lsocket"
)])
AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl")
])
AC_CHECK_FUNC(gethostbyname,,[
AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")
AC_CHECK_LIB(nsl,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lnsl",[
AC_CHECK_LIB(bind,gethostbyname,ipv4_LDFLAGS="${ipv4_LDFLAGS} -lbind")])
])
have_nanosleep=0
AC_CHECK_FUNC(nanosleep,have_nanosleep=1,[
......
......@@ -3,18 +3,24 @@
MAX_TEX_RECURSION=4
# For Debian :
XML_DECL=/usr/lib/sgml/declaration/xml.decl
HTML_SS=/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl
PRINT_SS=/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl
#XML_DECL=/usr/lib/sgml/declaration/xml.decl
#HTML_SS=/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/html/docbook.dsl
#PRINT_SS=/usr/lib/sgml/stylesheet/dsssl/docbook/nwalsh/print/docbook.dsl
# For RedHat :
#XML_DECL=/usr/lib/sgml/stylesheets/nwalsh-modular/dtds/decls/xml.dcl
#HTML_SS=/usr/lib/sgml/stylesheets/nwalsh-modular/html/docbook.dsl
#PRINT_SS=/usr/lib/sgml/stylesheets/nwalsh-modular/print/docbook.dsl
# For Mac OS X :
#XML_DECL=/usr/lib/sgml/declaration/xml.decl
HTML_SS=/sw/share/sgml/dsssl/docbook-dsssl-nwalsh/html/docbook.dsl
PRINT_SS=/sw/share/sgml/dsssl/docbook-dsssl-nwalsh/print/docbook.dsl
all: manual
JADE=jade
#JADE=jade
JADE=openjade
manual: manual.txt manual.ps manual.html
......
......@@ -2,7 +2,7 @@
* aout_internal.h : internal defines for audio output
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: aout_internal.h,v 1.5 2002/08/14 00:43:51 massiot Exp $
* $Id: aout_internal.h,v 1.6 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -27,8 +27,7 @@
typedef struct aout_alloc_t
{
int i_alloc_type;
int i_bytes_per_sec; /* -1 if only the alloc_type is
* relevant. */
int i_bytes_per_sec;
} aout_alloc_t;
#define AOUT_ALLOC_NONE 0
......@@ -86,6 +85,7 @@ typedef struct aout_fifo_t
vlc_mutex_t lock;
struct aout_buffer_t * p_first;
struct aout_buffer_t ** pp_last;
mtime_t end_date;
} aout_fifo_t;
static inline void aout_FifoInit( struct aout_instance_t * p_aout,
......@@ -94,6 +94,7 @@ static inline void aout_FifoInit( struct aout_instance_t * p_aout,
vlc_mutex_init( (vlc_object_t *)p_aout, &p_fifo->lock );
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
p_fifo->end_date = 0;
}
static inline void aout_FifoPush( struct aout_instance_t * p_aout,
......@@ -104,10 +105,42 @@ static inline void aout_FifoPush( struct aout_instance_t * p_aout,
*p_fifo->pp_last = p_buffer;
p_fifo->pp_last = &p_buffer->p_next;
*p_fifo->pp_last = NULL;
/* Enforce continuity of the stream. */
if ( p_fifo->end_date )
{
mtime_t duration = p_buffer->end_date - p_buffer->start_date;
p_buffer->start_date = p_fifo->end_date;
p_buffer->end_date = p_fifo->end_date =
p_buffer->start_date + duration;
}
else
{
p_fifo->end_date = p_buffer->end_date;
}
vlc_mutex_unlock( &p_fifo->lock );
}
/* This function supposes there is one buffer in p_fifo. */
static inline mtime_t aout_FifoNextStart( struct aout_instance_t * p_aout,
aout_fifo_t * p_fifo )
{
mtime_t end_date;
vlc_mutex_lock( &p_fifo->lock );
end_date = p_fifo->end_date;
vlc_mutex_unlock( &p_fifo->lock );
return end_date;
}
/* Reinit the end_date (for instance after a pause). */
static inline void aout_FifoSet( struct aout_instance_t * p_aout,
aout_fifo_t * p_fifo, mtime_t date )
{
vlc_mutex_lock( &p_fifo->lock );
p_fifo->end_date = date;
vlc_mutex_unlock( &p_fifo->lock );
}
/* This function supposes there is at least one buffer in p_fifo. */
static inline aout_buffer_t * aout_FifoPop( struct aout_instance_t * p_aout,
aout_fifo_t * p_fifo )
{
......@@ -164,8 +197,7 @@ typedef struct aout_filter_t
*****************************************************************************/
typedef struct aout_mixer_t
{
audio_sample_format_t input;
audio_sample_format_t output;
audio_sample_format_t mixer;
aout_alloc_t output_alloc;
module_t * p_module;
......@@ -188,7 +220,7 @@ struct aout_input_t
aout_fifo_t fifo;
mtime_t next_packet_date;
/* Mixer information */
byte_t * p_first_byte_to_mix;
};
......@@ -204,12 +236,11 @@ typedef struct aout_output_t
int i_nb_filters;
aout_fifo_t fifo;
mtime_t last_date;
struct module_t * p_module;
struct aout_sys_t * p_sys;
int (* pf_setformat)( aout_instance_t * );
void (* pf_play)( aout_instance_t *, aout_buffer_t * );
void (* pf_play)( aout_instance_t * );
int i_nb_samples;
} aout_output_t;
......@@ -229,8 +260,8 @@ struct aout_instance_t
int i_nb_inputs;
/* Mixer */
vlc_mutex_t mixer_lock;
vlc_cond_t mixer_signal;
vlc_cond_t mixer_signal; /* the associated mutex is
* p_aout->output.fifo.lock */
vlc_bool_t b_mixer_active;
aout_mixer_t mixer;
......@@ -247,8 +278,8 @@ void aout_InputPlay( aout_instance_t * p_aout, aout_input_t * p_input,
int aout_FiltersCreatePipeline( aout_instance_t * p_aout,
aout_filter_t ** pp_filters,
int * pi_nb_filters,
audio_sample_format_t * p_input_format,
audio_sample_format_t * p_output_format );
const audio_sample_format_t * p_input_format,
const audio_sample_format_t * p_output_format );
void aout_FiltersDestroyPipeline( aout_instance_t * p_aout,
aout_filter_t ** pp_filters,
int i_nb_filters );
......
......@@ -2,7 +2,7 @@
* audio_output.h : audio output interface
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: audio_output.h,v 1.59 2002/08/14 00:43:51 massiot Exp $
* $Id: audio_output.h,v 1.60 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -32,7 +32,12 @@ struct audio_sample_format_t
int i_rate;
int i_channels;
/* Optional - for A52, SPDIF and DTS types */
int i_bytes_per_sec;
int i_bytes_per_frame;
int i_frame_length;
/* Please note that it may be completely arbitrary - buffers are not
* obliged to contain a integral number of so-called "frames". It's
* just here for the division :
* i_nb_samples * i_bytes_per_frame / i_frame_length */
};
#define AOUT_FMT_MU_LAW 0x00000001
......@@ -56,6 +61,12 @@ struct audio_sample_format_t
&& ((p_first)->i_channels == (p_second)->i_channels \
|| (p_first)->i_channels == -1 || (p_second)->i_channels == -1) )
/* Check if i_rate == i_rate and i_channels == i_channels */
#define AOUT_FMTS_SIMILAR( p_first, p_second ) ( \
((p_first)->i_rate == (p_second)->i_rate) \
&& ((p_first)->i_channels == (p_second)->i_channels \
|| (p_first)->i_channels == -1 || (p_second)->i_channels == -1) )
#ifdef WORDS_BIGENDIAN
# define AOUT_FMT_S16_NE AOUT_FMT_S16_BE
# define AOUT_FMT_U16_NE AOUT_FMT_U16_BE
......@@ -103,7 +114,7 @@ struct aout_buffer_t
{
byte_t * p_buffer;
int i_alloc_type;
/* i_size is the real size of the buffer (normally unused), i_nb_bytes
/* i_size is the real size of the buffer (used for debug ONLY), i_nb_bytes
* is the number of significative bytes in it. */
size_t i_size, i_nb_bytes;
int i_nb_samples;
......@@ -125,7 +136,7 @@ VLC_EXPORT( void, aout_DeleteInstance, ( aout_instance_t * ) );
VLC_EXPORT( aout_buffer_t *, aout_BufferNew, ( aout_instance_t *, aout_input_t *, size_t ) );
VLC_EXPORT( void, aout_BufferDelete, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) );
VLC_EXPORT( void, aout_BufferPlay, ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) );
VLC_EXPORT( int, aout_FormatToByterate, ( audio_sample_format_t * p_format ) );
VLC_EXPORT( void, aout_FormatPrepare, ( audio_sample_format_t * p_format ) );
/* From input.c : */
#define aout_InputNew(a,b,c) __aout_InputNew(VLC_OBJECT(a),b,c)
......
......@@ -139,6 +139,10 @@
* will cause the calling thread to sleep */
#define AOUT_MAX_PREPARE_TIME (mtime_t)(.5*CLOCK_FREQ)
/* Max acceptable delay between the coded PTS and the actual presentation
* time, without resampling */
#define AOUT_PTS_TOLERANCE (mtime_t)(.03*CLOCK_FREQ)
/*****************************************************************************
* Video configuration
*****************************************************************************/
......
/* include/defs.h.in. Generated automatically from configure.in by autoheader 2.13. */
/* include/defs.h.in. Generated automatically from configure.in by autoheader. */
/* Define if using alloca.c. */
#undef C_ALLOCA
......
......@@ -36,7 +36,6 @@ struct module_symbols_t
int (* __vlc_thread_create_inner) ( vlc_object_t *, char *, int, char *, void * ( * ) ( void * ), vlc_bool_t ) ;
int (* __vlc_threads_end_inner) ( vlc_object_t * ) ;
int (* __vlc_threads_init_inner) ( vlc_object_t * ) ;
int (* aout_FormatToByterate_inner) ( audio_sample_format_t * p_format ) ;
int (* input_AccessInit_inner) ( input_thread_t * ) ;
int (* input_AddInfo_inner) ( input_info_category_t *, char *, char *, ... ) ;
int (* input_ChangeArea_inner) ( input_thread_t *, input_area_t * ) ;
......@@ -104,6 +103,7 @@ struct module_symbols_t
void (* aout_BufferDelete_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ;
void (* aout_BufferPlay_inner) ( aout_instance_t *, aout_input_t *, aout_buffer_t * ) ;
void (* aout_DeleteInstance_inner) ( aout_instance_t * ) ;
void (* aout_FormatPrepare_inner) ( audio_sample_format_t * p_format ) ;
void (* aout_InputDelete_inner) ( aout_instance_t *, aout_input_t * ) ;
void (* config_Duplicate_inner) ( module_t *, module_config_t * ) ;
void (* config_SetCallbacks_inner) ( module_config_t *, module_config_t * ) ;
......@@ -211,7 +211,7 @@ struct module_symbols_t
# define aout_BufferNew p_symbols->aout_BufferNew_inner
# define aout_BufferPlay p_symbols->aout_BufferPlay_inner
# define aout_DeleteInstance p_symbols->aout_DeleteInstance_inner
# define aout_FormatToByterate p_symbols->aout_FormatToByterate_inner
# define aout_FormatPrepare p_symbols->aout_FormatPrepare_inner
# define aout_InputDelete p_symbols->aout_InputDelete_inner
# define aout_OutputNextBuffer p_symbols->aout_OutputNextBuffer_inner
# define config_Duplicate p_symbols->config_Duplicate_inner
......
......@@ -2,7 +2,7 @@
* fixed32float32.c : converter from fixed32 to float32 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: fixed32tofloat32.c,v 1.4 2002/08/13 16:11:15 sam Exp $
* $Id: fixed32tofloat32.c,v 1.5 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -64,8 +64,7 @@ static int Create( vlc_object_t *p_this )
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate
|| p_filter->input.i_channels != p_filter->output.i_channels )
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
......@@ -73,8 +72,6 @@ static int Create( vlc_object_t *p_this )
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 1;
printf( "fixed32tofloat32 spawned.\n" );
return 0;
}
......
......@@ -2,7 +2,7 @@
* fixed32tos16.c : converter from fixed32 to signed 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: fixed32tos16.c,v 1.3 2002/08/13 16:11:15 sam Exp $
* $Id: fixed32tos16.c,v 1.4 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Jean-Paul Saman <jpsaman@wxs.nl>
*
......@@ -64,8 +64,7 @@ static int Create( vlc_object_t *p_this )
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate
|| p_filter->input.i_channels != p_filter->output.i_channels )
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
......@@ -73,7 +72,6 @@ static int Create( vlc_object_t *p_this )
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 1;
printf( "fixed32tos16 spawned.\n" );
return 0;
}
......
......@@ -2,7 +2,7 @@
* float32tos16.c : converter from float32 to signed 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tos16.c,v 1.7 2002/08/14 00:23:59 massiot Exp $
* $Id: float32tos16.c,v 1.8 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -64,13 +64,11 @@ static int Create( vlc_object_t *p_this )
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate
|| p_filter->input.i_channels != p_filter->output.i_channels )
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 1;
......
......@@ -2,7 +2,7 @@
* float32tos8.c : converter from float32 to signed 8 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tos8.c,v 1.2 2002/08/14 00:23:59 massiot Exp $
* $Id: float32tos8.c,v 1.3 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Xavier Maillard <zedek@fxgsproject.org>
*
......@@ -64,13 +64,11 @@ static int Create( vlc_object_t *p_this )
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate
|| p_filter->input.i_channels != p_filter->output.i_channels )
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 1;
......
......@@ -2,7 +2,7 @@
* float32tou16.c : converter from float32 to unsigned 16 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tou16.c,v 1.2 2002/08/14 00:23:59 massiot Exp $
* $Id: float32tou16.c,v 1.3 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Xavier Maillard <zedek@fxgsproject.org>
*
......@@ -64,8 +64,7 @@ static int Create( vlc_object_t *p_this )
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate
|| p_filter->input.i_channels != p_filter->output.i_channels )
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* float32tou8.c : converter from float32 to unsigned 8 bits integer
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: float32tou8.c,v 1.2 2002/08/14 00:23:59 massiot Exp $
* $Id: float32tou8.c,v 1.3 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Xavier Maillard <zedek@fxgsproject.org>
*
......@@ -64,13 +64,11 @@ static int Create( vlc_object_t *p_this )
return -1;
}
if ( p_filter->input.i_rate != p_filter->output.i_rate
|| p_filter->input.i_channels != p_filter->output.i_channels )
if ( !AOUT_FMTS_SIMILAR( &p_filter->input, &p_filter->output ) )
{
return -1;
}
p_filter->pf_do_work = DoWork;
p_filter->b_in_place = 1;
......
......@@ -2,7 +2,7 @@
* spdif.c : dummy mixer for S/PDIF output (1 input only)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: spdif.c,v 1.3 2002/08/14 00:23:59 massiot Exp $
* $Id: spdif.c,v 1.4 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -56,7 +56,7 @@ static int Create( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
if ( !AOUT_FMT_NON_LINEAR(&p_aout->mixer.output) )
if ( !AOUT_FMT_NON_LINEAR(&p_aout->mixer.mixer) )
{
return -1;
}
......
......@@ -2,7 +2,7 @@
* trivial.c : trivial mixer plug-in (1 input, no downmixing)
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: trivial.c,v 1.4 2002/08/12 22:12:50 massiot Exp $
* $Id: trivial.c,v 1.5 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -56,8 +56,8 @@ static int Create( vlc_object_t *p_this )
{
aout_instance_t * p_aout = (aout_instance_t *)p_this;
if ( p_aout->mixer.output.i_format != AOUT_FMT_FLOAT32
&& p_aout->mixer.output.i_format != AOUT_FMT_FIXED32 )
if ( p_aout->mixer.mixer.i_format != AOUT_FMT_FLOAT32
&& p_aout->mixer.mixer.i_format != AOUT_FMT_FIXED32 )
{
return -1;
}
......@@ -67,6 +67,7 @@ static int Create( vlc_object_t *p_this )
return 0;
}
#if 0
/*****************************************************************************
* SparseCopy: trivially downmix or upmix a buffer
*****************************************************************************/
......@@ -85,6 +86,7 @@ static void SparseCopy( u32 * p_dest, const u32 * p_src, size_t i_len,
p_dest += i_output_stride;
}
}
#endif
/*****************************************************************************
* DoWork: mix a new output buffer
......@@ -92,111 +94,44 @@ static void SparseCopy( u32 * p_dest, const u32 * p_src, size_t i_len,
static void DoWork( aout_instance_t * p_aout, aout_buffer_t * p_buffer )
{
aout_input_t * p_input = p_aout->pp_inputs[0];
int i_nb_bytes = p_buffer->i_nb_samples * sizeof(u32)
* p_aout->mixer.mixer.i_channels;
byte_t * p_in = p_input->p_first_byte_to_mix;
byte_t * p_out = p_buffer->p_buffer;
if ( p_input->input.i_channels == p_aout->mixer.output.i_channels )
for ( ; ; )
{
int i_nb_bytes = p_buffer->i_nb_samples * sizeof(u32)
* p_input->input.i_channels;
byte_t * p_in = (p_input->p_first_byte_to_mix == NULL) ?
p_input->fifo.p_first->p_buffer :
p_input->p_first_byte_to_mix;
byte_t * p_out = p_buffer->p_buffer;
for ( ; ; )
ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer
- p_in)
+ p_input->fifo.p_first->i_nb_samples
* sizeof(u32)
* p_aout->mixer.mixer.i_channels;
if ( i_available_bytes < i_nb_bytes )
{
ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer
- p_in)
+ p_input->fifo.p_first->i_nb_samples
* sizeof(u32)
* p_input->input.i_channels;
aout_buffer_t * p_old_buffer;
if ( i_available_bytes < i_nb_bytes )
{
aout_buffer_t * p_old_buffer;
if ( i_available_bytes > 0 )
p_aout->p_vlc->pf_memcpy( p_out, p_in, i_available_bytes );
i_nb_bytes -= i_available_bytes;
p_out += i_available_bytes;
/* Next buffer */
p_old_buffer = aout_FifoPop( p_aout, &p_input->fifo );
aout_BufferFree( p_old_buffer );
if ( p_input->fifo.p_first == NULL )
{
msg_Err( p_aout, "internal amix error" );
return;
}
p_in = p_input->fifo.p_first->p_buffer;
}
else
if ( i_available_bytes > 0 )
p_aout->p_vlc->pf_memcpy( p_out, p_in, i_available_bytes );
i_nb_bytes -= i_available_bytes;
p_out += i_available_bytes;
/* Next buffer */
p_old_buffer = aout_FifoPop( p_aout, &p_input->fifo );
aout_BufferFree( p_old_buffer );
if ( p_input->fifo.p_first == NULL )
{
p_aout->p_vlc->pf_memcpy( p_out, p_in, i_nb_bytes );
p_input->p_first_byte_to_mix = p_in + i_nb_bytes;
break;
msg_Err( p_aout, "internal amix error" );
return;
}
p_in = p_input->fifo.p_first->p_buffer;
}
}
else
{
/* Downmixing or upmixing. */
int i_nb_samples = p_buffer->i_nb_samples;
u32 * p_in = (p_input->p_first_byte_to_mix == NULL) ?
(u32 *)p_input->fifo.p_first->p_buffer :
(u32 *)p_input->p_first_byte_to_mix;
u32 * p_out = (u32 *)p_buffer->p_buffer;
if ( p_input->input.i_channels < p_aout->mixer.output.i_channels )
else
{
/* Zero out the destination buffer, to avoid static on unavailable
* channels. */
memset( p_buffer->p_buffer, 0,
p_buffer->i_nb_samples * sizeof(u32)
* p_aout->mixer.output.i_channels );
}
for ( ; ; )
{
ptrdiff_t i_available_bytes = (p_input->fifo.p_first->p_buffer
- (byte_t *)p_in)
+ p_input->fifo.p_first->i_nb_samples
* sizeof(u32)
* p_input->input.i_channels;
int i_available_samples = i_available_bytes
/ p_input->input.i_channels
/ sizeof(u32);
if ( i_available_samples < i_nb_samples )
{
aout_buffer_t * p_old_buffer;
if ( i_available_samples > 0 )
SparseCopy( p_out, p_in, i_available_samples,
p_aout->mixer.output.i_channels,
p_input->input.i_channels );
i_nb_samples -= i_available_samples;
p_out += i_available_samples * p_aout->mixer.output.i_channels;
/* Next buffer */
p_old_buffer = aout_FifoPop( p_aout, &p_input->fifo );
aout_BufferFree( p_old_buffer );
if ( p_input->fifo.p_first == NULL )
{
msg_Err( p_aout, "internal amix error" );
return;
}
p_in = (u32 *)p_input->fifo.p_first->p_buffer;
}
else
{
SparseCopy( p_out, p_in, i_nb_samples,
p_aout->mixer.output.i_channels,
p_input->input.i_channels );
p_input->p_first_byte_to_mix = (byte_t *)p_in
+ i_nb_samples * p_input->input.i_channels
* sizeof(u32);
break;
}
if ( i_nb_bytes > 0 )
p_aout->p_vlc->pf_memcpy( p_out, p_in, i_nb_bytes );
p_input->p_first_byte_to_mix = p_in + i_nb_bytes;
break;
}
}
}
......
......@@ -2,7 +2,7 @@
* alsa.c : alsa plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001 VideoLAN
* $Id: alsa.c,v 1.4 2002/08/19 17:07:14 bozo Exp $
* $Id: alsa.c,v 1.5 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Henri Fallon <henri@videolan.org> - Original Author
* Jeffrey Baker <jwbaker@acm.org> - Port to ALSA 1.0 API
......@@ -79,8 +79,7 @@ static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static int SetFormat ( aout_instance_t * );
static void Play ( aout_instance_t *,
aout_buffer_t * );
static void Play ( aout_instance_t * );
static int ALSAThread ( aout_instance_t * );
static void ALSAFill ( aout_instance_t * );
......@@ -343,9 +342,8 @@ static int SetFormat( aout_instance_t * p_aout )
/*****************************************************************************
* Play: queue a buffer for playing by ALSAThread
*****************************************************************************/
static void Play( aout_instance_t *p_aout, aout_buffer_t * p_buffer )
static void Play( aout_instance_t *p_aout )
{
aout_FifoPush( p_aout, &p_aout->output.fifo, p_buffer );
}
/*****************************************************************************
......
......@@ -59,7 +59,7 @@ static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static int SetFormat ( aout_instance_t * );
static void Play ( aout_instance_t *, aout_buffer_t * );
static void Play ( aout_instance_t * );
static int aRtsThread ( aout_instance_t * );
/*****************************************************************************
......@@ -159,9 +159,8 @@ static int SetFormat( aout_instance_t *p_aout )
/*****************************************************************************
* Play: queue a buffer for playing by aRtsThread
*****************************************************************************/
static void Play( aout_instance_t *p_aout, aout_buffer_t * p_buffer )
static void Play( aout_instance_t *p_aout );
{
aout_FifoPush( p_aout, &p_aout->output.fifo, p_buffer );
}
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* esd.c : EsounD module
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: esd.c,v 1.6 2002/08/14 13:10:44 sam Exp $
* $Id: esd.c,v 1.7 2002/08/19 21:31:11 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -58,7 +58,7 @@ static int Open ( vlc_object_t * );
static void Close ( vlc_object_t * );
static int SetFormat ( aout_instance_t * );
static void Play ( aout_instance_t *, aout_buffer_t * );
static void Play ( aout_instance_t * );
static int ESDThread ( aout_instance_t * );
/*****************************************************************************
......@@ -160,9 +160,8 @@ static int SetFormat( aout_instance_t *p_aout )
/*****************************************************************************
* Play: queue a buffer for playing by ESDThread
*****************************************************************************/
static void Play( aout_instance_t *p_aout, aout_buffer_t * p_buffer )
static void Play( aout_instance_t *p_aout )
{