changeset 28132:c28c36d595d5

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].
author reimar
date Sat, 20 Dec 2008 10:18:15 +0000
parents e2c13ec41971
children 272238675b78
files libmpcodecs/ae_lavc.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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;