diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-12-20 10:18:15 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-12-20 10:18:15 +0000 |
commit | 1b14e4f420fc754593219e470ed948b40e648240 (patch) | |
tree | a4f1c1ee4c2e52ef34824d98730a0fbebf6b218d /libmpcodecs | |
parent | 121857d6ff101bf5f277397fe274a3fa866a3d05 (diff) |
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
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ae_lavc.c | 4 |
1 files changed, 2 insertions, 2 deletions
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; |