[MPlayer-dev-eng] [PATCH] lavc audio: fix wave format header for ima adpcm wav files #2

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Dec 18 14:54:35 CET 2008


On Thu, Dec 18, 2008 at 01:45:07PM +0000, Edouard Gomez wrote:
> --- libmpcodecs/ae_lavc.c	
> +++ libmpcodecs/ae_lavc.c
> @@ -67,8 +67,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;
> +			*(uint16_t*)(mux_a->wf+1) = le2me_16((uint16_t)lavc_actx->frame_size);

AV_WL16(mux_a->wf+1, lavc_actx->framesize);

If it does not compile, add
#include "libavutil/intreadwrite.h"



More information about the MPlayer-dev-eng mailing list