[vlc-devel] commit: Sets the output channel configuration when opening the decoder ( Rafaël Carré )
git version control
git at videolan.org
Mon Apr 14 16:13:54 CEST 2008
vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Apr 14 16:13:21 2008 +0200| [3b420ec94e74840c9e9a22f1a73a442c24d3d0b2]
Sets the output channel configuration when opening the decoder
Signed-off-by: Meuuh the cow
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3b420ec94e74840c9e9a22f1a73a442c24d3d0b2
---
modules/codec/ffmpeg/audio.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/modules/codec/ffmpeg/audio.c b/modules/codec/ffmpeg/audio.c
index 5f4d989..ef48be5 100644
--- a/modules/codec/ffmpeg/audio.c
+++ b/modules/codec/ffmpeg/audio.c
@@ -112,6 +112,18 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
/* ***** Fill p_context with init values ***** */
p_sys->p_context->sample_rate = p_dec->fmt_in.audio.i_rate;
p_sys->p_context->channels = p_dec->fmt_in.audio.i_channels;
+ if( !p_dec->fmt_in.audio.i_physical_channels )
+ {
+ msg_Warn( p_dec, "Physical channel configuration not set : guessing" );
+ p_dec->fmt_in.audio.i_original_channels =
+ p_dec->fmt_in.audio.i_physical_channels =
+ pi_channels_maps[p_sys->p_context->channels];
+ }
+
+ p_dec->fmt_out.audio.i_physical_channels =
+ p_dec->fmt_out.audio.i_original_channels =
+ p_dec->fmt_in.audio.i_physical_channels;
+
p_sys->p_context->block_align = p_dec->fmt_in.audio.i_blockalign;
p_sys->p_context->bit_rate = p_dec->fmt_in.i_bitrate;
p_sys->p_context->bits_per_sample = p_dec->fmt_in.audio.i_bitspersample;
More information about the vlc-devel
mailing list