From 63cc2debd270aab0541f33deec616a358684e396 Mon Sep 17 00:00:00 2001 From: Steinar Gunderson Date: Sun, 26 Sep 2010 02:21:28 +0200 Subject: [PATCH 1/1] Minor comment cleanup. --- modules/codec/lpcm.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/codec/lpcm.c b/modules/codec/lpcm.c index f323304c9e..908fb934fc 100644 --- a/modules/codec/lpcm.c +++ b/modules/codec/lpcm.c @@ -48,7 +48,7 @@ static void CloseCommon ( vlc_object_t * ); #ifdef ENABLE_SOUT static int OpenEncoder ( vlc_object_t * ); static void CloseEncoder ( vlc_object_t * ); -static block_t *EncoderEncode( encoder_t *, aout_buffer_t * ); +static block_t *EncodeFrames( encoder_t *, aout_buffer_t * ); #endif vlc_module_begin () @@ -423,29 +423,28 @@ static void CloseCommon( vlc_object_t *p_this ) } /***************************************************************************** - * OpenEncoder: + * OpenEncoder: lpcm encoder construction *****************************************************************************/ static int OpenEncoder( vlc_object_t *p_this ) { encoder_t *p_enc = (encoder_t *)p_this; encoder_sys_t *p_sys; + /* We only support DVD LPCM yet. */ if( p_enc->fmt_out.i_codec != VLC_CODEC_DVD_LPCM || ( p_enc->fmt_in.audio.i_rate != 48000 && p_enc->fmt_in.audio.i_rate != 96000 && p_enc->fmt_in.audio.i_rate != 44100 && p_enc->fmt_in.audio.i_rate != 32000 ) || p_enc->fmt_in.audio.i_channels > 8 ) - { return VLC_EGENERIC; - } /* Allocate the memory needed to store the encoder's structure */ if( ( p_enc->p_sys = p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL ) return VLC_ENOMEM; - p_enc->pf_encode_audio = EncoderEncode; + p_enc->pf_encode_audio = EncodeFrames; p_enc->fmt_in.i_codec = p_enc->fmt_out.i_codec; p_enc->fmt_in.audio.i_bitspersample = 16; @@ -472,7 +471,7 @@ static int OpenEncoder( vlc_object_t *p_this ) } /***************************************************************************** - * CloseEncoder + * CloseEncoder: lpcm encoder destruction *****************************************************************************/ static void CloseEncoder ( vlc_object_t *p_this ) { @@ -480,9 +479,9 @@ static void CloseEncoder ( vlc_object_t *p_this ) } /***************************************************************************** - * EncoderEncode: + * EncodeFrames: encode zero or more LCPM audio packets *****************************************************************************/ -static block_t *EncoderEncode( encoder_t *p_enc, aout_buffer_t *p_aout_buf ) +static block_t *EncodeFrames( encoder_t *p_enc, aout_buffer_t *p_aout_buf ) { encoder_sys_t *p_sys = p_enc->p_sys; block_t *p_first_block = NULL, *p_last_block = NULL; @@ -545,7 +544,7 @@ static block_t *EncoderEncode( encoder_t *p_enc, aout_buffer_t *p_aout_buf ) */ p_block->i_dts = p_block->i_pts = p_aout_buf->i_pts + i * p_sys->i_frame_samples * CLOCK_FREQ / p_sys->i_rate; p_block->i_length = p_sys->i_frame_samples * CLOCK_FREQ / p_sys->i_rate; - + if( !p_first_block ) p_first_block = p_last_block = p_block; else -- 2.39.2