/*****************************************************************************
* common.c : audio output management of common data structures
*****************************************************************************
- * Copyright (C) 2002-2005 the VideoLAN team
+ * Copyright (C) 2002-2007 the VideoLAN team
* $Id$
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
/*****************************************************************************
* Preamble
*****************************************************************************/
-#include <stdlib.h> /* calloc(), malloc(), free() */
-#include <string.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
#include <vlc/vlc.h>
-
-#include "audio_output.h"
+#include <vlc_aout.h>
#include "aout_internal.h"
-
/*
* Instances management (internal and external)
*/
p_aout->output.b_starving = 1;
var_Create( p_aout, "intf-change", VLC_VAR_BOOL );
- val.b_bool = VLC_TRUE;
+ val.b_bool = true;
var_Set( p_aout, "intf-change", val );
return p_aout;
vlc_mutex_destroy( &p_aout->output_fifo_lock );
/* Free structure. */
- vlc_object_destroy( p_aout );
+ vlc_object_release( p_aout );
}
void aout_FifoInit( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
uint32_t i_rate )
{
+ if( i_rate == 0 )
+ {
+ msg_Err( p_aout, "initialising fifo with zero divider" );
+ }
+
p_fifo->p_first = NULL;
p_fifo->pp_last = &p_fifo->p_first;
aout_DateInit( &p_fifo->end_date, i_rate );
void aout_FifoPush( aout_instance_t * p_aout, aout_fifo_t * p_fifo,
aout_buffer_t * p_buffer )
{
+ (void)p_aout;
*p_fifo->pp_last = p_buffer;
p_fifo->pp_last = &p_buffer->p_next;
*p_fifo->pp_last = NULL;
mtime_t date )
{
aout_buffer_t * p_buffer;
+ (void)p_aout;
aout_DateSet( &p_fifo->end_date, date );
p_buffer = p_fifo->p_first;
mtime_t difference )
{
aout_buffer_t * p_buffer;
+ (void)p_aout;
aout_DateMove( &p_fifo->end_date, difference );
p_buffer = p_fifo->p_first;
*****************************************************************************/
mtime_t aout_FifoNextStart( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
{
+ (void)p_aout;
return aout_DateGet( &p_fifo->end_date );
}
*****************************************************************************/
mtime_t aout_FifoFirstDate( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
{
+ (void)p_aout;
return p_fifo->p_first ? p_fifo->p_first->start_date : 0;
}
aout_buffer_t * aout_FifoPop( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
{
aout_buffer_t * p_buffer;
+ (void)p_aout;
p_buffer = p_fifo->p_first;
if ( p_buffer == NULL ) return NULL;
void aout_FifoDestroy( aout_instance_t * p_aout, aout_fifo_t * p_fifo )
{
aout_buffer_t * p_buffer;
+ (void)p_aout;
p_buffer = p_fifo->p_first;
while ( p_buffer != NULL )
*****************************************************************************/
void aout_DateInit( audio_date_t * p_date, uint32_t i_divider )
{
- if( i_divider == 0 )
- {
- msg_Err( p_aout, "initialising date with zero divider" );
- }
-
p_date->date = 0;
p_date->i_divider = i_divider;
p_date->i_remainder = 0;
uint32_t i_channel_mask,
int i_channels, int *pi_chan_table )
{
- vlc_bool_t b_chan_reorder = VLC_FALSE;
+ bool b_chan_reorder = false;
int i, j, k, l;
- if( i_channels > AOUT_CHAN_MAX ) return VLC_FALSE;
+ if( i_channels > AOUT_CHAN_MAX ) return false;
for( i = 0, j = 0; pi_chan_order_in[i]; i++ )
{
for( i = 0; i < i_channels; i++ )
{
- if( pi_chan_table[i] != i ) b_chan_reorder = VLC_TRUE;
+ if( pi_chan_table[i] != i ) b_chan_reorder = true;
}
return b_chan_reorder;