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

zhentan feng spyfeng
Wed Apr 1 13:42:15 CEST 2009


Hi

2009/4/1 Ronald S. Bultje <rsbultje at gmail.com>

> Hi,
>
> On Tue, Mar 31, 2009 at 1:45 PM, zhentan feng <spyfeng at gmail.com> wrote:
> >> > +    if (waveformatextensible) {                     /* write
> >> WAVEFORMATEXTENSIBLE extensions */
> >> > +        update_size_pos = url_ftell(pb);
> >> > +        put_le16(pb, enc->extradata_size+22);       /* 22 is the size
> of
> >> WAVEFORMATEXTENSIBLE-WAVEFORMATEX */
> [..]
> >> > +    if (!url_is_streamed(pb)){
> >> > +        if (hdrsize > 40 && waveformatextensible) { /*  40 means 22
> >> WAVEFORMATEXTENSBLE size + 18 */
> >> > +            pos = url_ftell(pb);
> >> > +            url_fseek(pb, update_size_pos, SEEK_SET);
> >> > +            put_le16(pb, hdrsize - 18);
> >> > +            url_fseek(pb, pos, SEEK_SET);
> >> > +        }
> >> > +    }
> >>
> >> fails if url_is_streamed
>
> This isn't needed at all.
>
> Zhentan, just calculate the size in advance, don't do unnecessary
> seeking, it will complicate your code in the end. Just calculate the
> size of the data after the default tag, and write it correctly
> directly. You know (or can within reasonable terms calculate) the data
> size in advance.
>
> [...]


yes, thanks. I should have thought of it.
I am entangled with url_is_streamed problem ;)
-- 
Best wishes~



More information about the ffmpeg-devel mailing list