[FFmpeg-devel] [PATCH] Wave64 demuxer
Reimar Döffinger
Reimar.Doeffinger
Fri Aug 7 22:13:33 CEST 2009
On Fri, Aug 07, 2009 at 03:04:25PM -0400, Daniel Verkamp wrote:
> On Fri, Aug 7, 2009 at 2:44 PM, Daniel Verkamp<daniel at drv.nu> wrote:
> > On Fri, Aug 7, 2009 at 1:52 PM, Reimar
> > D?ffinger<Reimar.Doeffinger at gmx.de> wrote:
> [...]
> >> But this whole thing looks a lot like a normal wav file just with
> >> some extension, are you sure this should be a completely new demuxer
> >> instead of an extension to the "normal" one?
> >
> > I thought about that too, but I don't think it would be any cleaner or
> > shorter. ?The header is different except for the parts that are
> > already shared in ff_get_wav_header(), so it would just be a big mess
> > of if(w64){}else{}. ?I can reconsider combining them if that's really
> > desirable, though. ?I suppose read_packet could be shared with some
> > changes...
> >
>
> Quick attempt at reusing more WAV demuxer code for W64... I prefer the
> previous patch, but this works too.
No idea/opinion, but could you provide a sample file?
> @@ -209,10 +294,16 @@ static int wav_read_packet(AVFormatContext *s,
>
> left= wav->data_end - url_ftell(s->pb);
> if(left <= 0){
> + if (wav->w64) {
> + left = find_guid(s->pb, ff_w64_guid_data);
> + if (left < 0)
> + return AVERROR_EOF;
> + } else {
> left = find_tag(s->pb, MKTAG('d', 'a', 't', 'a'));
> if (left < 0) {
> return AVERROR(EIO);
> }
> + }
Obviously just using
left = wav->w64 ?
find_guid(s->pb, ff_w64_guid_data) :
find_tag(s->pb, MKTAG('d', 'a', 't', 'a');
would do it here...
More information about the ffmpeg-devel
mailing list