# HG changeset patch # User reimar # Date 1229768295 0 # Node ID c28c36d595d595993dce374f88a0a39577e2859b # Parent e2c13ec419715e2ff1e0b834c8f411f8a3af06cc 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]. diff -r e2c13ec41971 -r c28c36d595d5 libmpcodecs/ae_lavc.c --- a/libmpcodecs/ae_lavc.c Fri Dec 19 21:18:31 2008 +0000 +++ b/libmpcodecs/ae_lavc.c Sat Dec 20 10:18:15 2008 +0000 @@ -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 @@ 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;