[FFmpeg-devel] Add waveformat extensible support in wav muxer (SoC qualification task)

zhentan feng spyfeng
Tue Mar 31 03:46:29 CEST 2009


Hi

2009/3/31 Michael Niedermayer <michaelni at gmx.at>

> [...]
> > here is the new patch for version 0.5.
> > according to get_wav_header() fucntion, write the WAVEFORMATEXTENSIBLE
> > struct first and update the extrasize if necessary.
> >
> [...]
> > @@ -343,16 +365,14 @@
> >          put_le16(pb, 16); /* fwHeadFlags */
> >          put_le32(pb, 0);  /* dwPTSLow */
> >          put_le32(pb, 0);  /* dwPTSHigh */
> > -    } else if (enc->codec_id == CODEC_ID_GSM_MS) {
> > -        put_le16(pb, 2); /* wav_extra_size */
> > +    } else if (enc->codec_id == CODEC_ID_GSM_MS || enc->codec_id ==
> CODEC_ID_ADPCM_IMA_WAV) {
> > +        if (!waveformatextensible)
> > +            put_le16(pb, 2); /* wav_extra_size */
> >          hdrsize += 2;
> >          put_le16(pb, enc->frame_size); /* wSamplesPerBlock */
> > -    } else if (enc->codec_id == CODEC_ID_ADPCM_IMA_WAV) {
> > -        put_le16(pb, 2); /* wav_extra_size */
> > -        hdrsize += 2;
> > -        put_le16(pb, enc->frame_size); /* wSamplesPerBlock */
> > -    } else if(enc->extradata_size){
> > -        put_le16(pb, enc->extradata_size);
> > +    } else if (enc->extradata_size){
> > +        if (!waveformatextensible)
> > +            put_le16(pb, enc->extradata_size);
> >          put_buffer(pb, enc->extradata, enc->extradata_size);
> >          hdrsize += enc->extradata_size;
> >          if(hdrsize&1){
>
> factorizing code should be in a seperate patch
>
>
> > @@ -363,6 +383,10 @@
> >          hdrsize -= 2;
> >      }
> >
> > +    if (hdrsize > 40 && waveformatextensible) { /*  40 means 22
> WAVEFORMATEXTENSBLE size + 18 */
> > +        put_le16(update_pb, hdrsize - 18);
> > +    }
> > +
> >      return hdrsize;
> >  }
> >
>
> this is not correct
>

thanks for reviewing the patch.

do you mean the if condition is not correct or the way of updating size is
wrong?

if it is the update size problem, is it correct to use url_feek() for
updating the size?

zhentan feng
-- 
Best wishes~



More information about the ffmpeg-devel mailing list