[FFmpeg-devel] [PATCH] Parse bext metadata in wav (BWF)

Michael Niedermayer michaelni
Thu Mar 3 00:44:32 CET 2011


On Wed, Mar 02, 2011 at 05:52:22PM +0100, Benjamin Larsson wrote:
> On 03/02/2011 04:14 PM, Tomas H?rdin wrote:
> > Hi
> > 
> > The following patch set makes the wav demuxer parse the bext tag used in
> > the Broadcast Wave Format (BWF). Doing so requires reworking the wav
> > demuxer a bit, since it stops parsing the file once the data tag has
> > been found. I have a sample where said tag is in the footer.
> > 
> > In short, it'll parse the entire file if the file is seekable. If it's
> > non-seekable then only the header is parsed. Any tags encountered are
> > handled by the same switch statement, so tags before the fmt tag won't
> > get ignored.
> > 
> > I have no idea how to git-send-mail work on Windows, so mailing all
> > patches might take a minute or two.
> > 
> > /Tomas
> 

> @@ -258,7 +265,21 @@ static int wav_read_header(AVFormatContext *s,
>                  return AVERROR_INVALIDDATA;
>              }
>
> +    if (!rf64)
> +        data_size = size;
> +    if (!data_size) {
> +        wav->data_end = INT64_MAX;
> +    } else
> +        wav->data_end= url_ftell(pb) + data_size;
> +
> +            /* we can't look for metadata past the data tag if streaming, so stop parsing */
> +            if (pb->is_streamed)
>              goto break_loop;
> +
> +            /* keep going in order to parse footer metadata chunks */
> +            data_ofs = url_ftell(pb);
> +            next_tag_ofs = wav->data_end;
> +            break;
>          case MKTAG('f','a','c','t'):
>              if(!sample_count)
>              sample_count = avio_rl32(pb);
[...]
> Looks ok.

no comment

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Many things microsoft did are stupid, but not doing something just because
microsoft did it is even more stupid. If everything ms did were stupid they
would be bankrupt already.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110303/edd2fb7b/attachment.pgp>



More information about the ffmpeg-devel mailing list