[vlc-devel] commit: Fixed avcodec wrapper with unrecognized audio layout. ( Laurent Aimar )

git version control git at videolan.org
Sat Jun 13 11:42:20 CEST 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Jun 13 11:28:32 2009 +0200| [cd2f14472dfbf549b401a340749b64f7123720b7] | committer: Laurent Aimar 

Fixed avcodec wrapper with unrecognized audio layout.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd2f14472dfbf549b401a340749b64f7123720b7
---

 modules/codec/avcodec/audio.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/audio.c b/modules/codec/avcodec/audio.c
index 8a6f802..a4a5436 100644
--- a/modules/codec/avcodec/audio.c
+++ b/modules/codec/avcodec/audio.c
@@ -243,7 +243,7 @@ static aout_buffer_t *SplitBuffer( decoder_t *p_dec )
     else
         memcpy( p_buffer->p_buffer, p_sys->p_samples, p_buffer->i_nb_bytes );
 
-    p_sys->p_samples += p_buffer->i_nb_bytes;
+    p_sys->p_samples += i_samples * p_sys->p_context->channels * ( p_dec->fmt_out.audio.i_bitspersample / 8 );
     p_sys->i_samples -= i_samples;
 
     return p_buffer;
@@ -481,7 +481,6 @@ static void SetupOutputFormat( decoder_t *p_dec, bool b_trust )
     p_dec->fmt_out.audio.i_bitspersample = 16;
 #endif
     p_dec->fmt_out.audio.i_rate     = p_sys->p_context->sample_rate;
-    p_dec->fmt_out.audio.i_channels = p_sys->p_context->channels;
 
     /* */
 #if defined(LIBAVCODEC_AUDIO_LAYOUT)




More information about the vlc-devel mailing list