From 1b14e4f420fc754593219e470ed948b40e648240 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 20 Dec 2008 10:18:15 +0000 Subject: Fix imaadpcm extradata with lavc encoder. The formula to calculate frame size was wrong, duplicated code from the encoder and did not take endianness into account when writing the value into extradata. Patch by Edouard Gomez [ed gomez (at) free fr]. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28167 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/ae_lavc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmpcodecs') diff --git a/libmpcodecs/ae_lavc.c b/libmpcodecs/ae_lavc.c index fe18ab786e..b31eb62fce 100644 --- a/libmpcodecs/ae_lavc.c +++ b/libmpcodecs/ae_lavc.c @@ -16,6 +16,7 @@ #include "libaf/af_format.h" #include "libaf/reorder_ch.h" #include "libavcodec/avcodec.h" +#include "libavutil/intreadwrite.h" static AVCodec *lavc_acodec; static AVCodecContext *lavc_actx; @@ -67,8 +68,7 @@ static int bind_lavc(audio_encoder_t *encoder, muxer_stream_t *mux_a) case 0x11: /* imaadpcm */ mux_a->wf->wBitsPerSample = 4; mux_a->wf->cbSize = 2; - ((uint16_t*)mux_a->wf)[sizeof(WAVEFORMATEX)] = - ((lavc_actx->block_align - 4 * lavc_actx->channels) / (4 * lavc_actx->channels)) * 8 + 1; + AV_WL16(mux_a->wf+1, lavc_actx->frame_size); break; case 0x55: /* mp3 */ mux_a->wf->cbSize = 12; -- cgit v1.2.3