[MPlayer-cvslog] r28167 - trunk/libmpcodecs/ae_lavc.c

reimar subversion at mplayerhq.hu
Sat Dec 20 11:18:16 CET 2008


Author: reimar
Date: Sat Dec 20 11:18:15 2008
New Revision: 28167

Log:
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].


Modified:
   trunk/libmpcodecs/ae_lavc.c

Modified: trunk/libmpcodecs/ae_lavc.c
==============================================================================
--- trunk/libmpcodecs/ae_lavc.c	(original)
+++ trunk/libmpcodecs/ae_lavc.c	Sat Dec 20 11:18:15 2008
@@ -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 *en
 		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;



More information about the MPlayer-cvslog mailing list