* araw.c: Pseudo audio decoder; for raw pcm data
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
- * $Id: araw.c,v 1.14 2003/03/11 17:40:40 fenrir Exp $
+ * $Id: araw.c,v 1.15 2003/05/17 20:30:31 gbazin Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
{
WAVEFORMATEX *p_wf;
- /* The bit stream structure handles the PES stream at the bit level */
-// bit_stream_t bit_stream;
-
/* Input properties */
decoder_fifo_t *p_fifo;
int16_t *p_logtos16; // used with m/alaw to s16
*****************************************************************************/
static int InitThread( adec_thread_t * p_adec )
{
- if( ( p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_waveformatex ) == NULL )
+ if( ( p_adec->p_wf = (WAVEFORMATEX*)p_adec->p_fifo->p_waveformatex )
+ == NULL )
{
msg_Err( p_adec->p_fifo, "unknown raw format" );
return( -1 );
}
msg_Dbg( p_adec->p_fifo,
- "raw format: samplerate:%dHz channels:%d bits/sample:%d blockalign:%d",
+ "raw format: samplerate:%dHz channels:%d bits/sample:%d "
+ "blockalign:%d",
p_adec->p_wf->nSamplesPerSec,
p_adec->p_wf->nChannels,
p_adec->p_wf->wBitsPerSample,
}
p_adec->output_format.i_rate = p_adec->p_wf->nSamplesPerSec;
- if( p_adec->p_wf->nChannels <= 0 ||
- p_adec->p_wf->nChannels > 5 )
+ if( p_adec->p_wf->nChannels <= 0 || p_adec->p_wf->nChannels > 5 )
{
msg_Err( p_adec->p_fifo, "bad channels count(1-5)" );
return( -1 );
return( -1 );
}
- /* Init the BitStream */
-// InitBitstream( &p_adec->bit_stream, p_adec->p_fifo,
-// NULL, NULL );
-
return( 0 );
}
while( p_data != NULL && i_count < i_max )
{
- i_copy = __MIN( p_data->p_payload_end - p_data->p_payload_start, i_max - i_count );
+ i_copy = __MIN( p_data->p_payload_end - p_data->p_payload_start,
+ i_max - i_count );
if( i_copy > 0 )
{
return;
}
- i_samples = i_size /
- ( ( p_adec->p_wf->wBitsPerSample + 7 ) / 8 ) /
+ i_samples = i_size / ( ( p_adec->p_wf->wBitsPerSample + 7 ) / 8 ) /
p_adec->p_wf->nChannels;
-// msg_Warn( p_adec->p_fifo, "got %d samples (%d bytes)", i_samples, i_size );
p_adec->pts = p_pes->i_pts;
/* **** Now we can output these samples **** */
}
else
{
- memcpy( p_aout_buffer->p_buffer,
- p,
+ memcpy( p_aout_buffer->p_buffer, p,
p_aout_buffer->i_nb_bytes );
p += p_aout_buffer->i_nb_bytes;
input_DeletePES( p_adec->p_fifo->p_packets_mgt, p_pes );
}
-
/*****************************************************************************
* EndThread : faad decoder thread destruction
*****************************************************************************/
free( p_adec );
}
-
-