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

Reimar Doeffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Dec 18 12:14:12 CET 2008


On Thu, Dec 18, 2008 at 12:05:15PM +0100, Reimar Doeffinger wrote:
> On Thu, Dec 18, 2008 at 11:54:43AM +0100, ed.gomez at free.fr wrote:
> > @@ -67,8 +67,8 @@
> >  		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) = 
> > +				((lavc_actx->block_align - 4 * lavc_actx->channels) * 8 / (4 * lavc_actx->channels)) + 1;
> >  			break;
> 
> This looks wrong, I'd expect it to break on bigendian systems, AV_WL16 probably is the right thing to use.
> The formula looks very weird to me either way, but I'd have to check the decoder.

Well, after looking at the encoder, why not just use lavc_actx->frame_size instead of duplicating the code?



More information about the MPlayer-dev-eng mailing list