[FFmpeg-devel] [PATCH] Video decoder and demuxer for AMV files

Vladimir Voroshilov voroshil
Mon Sep 24 21:46:16 CEST 2007


Hi, Aurelien

2007/9/25, Aurelien Jacobs <aurel at gnuage.org>:
> Vladimir Voroshilov wrote:
>
> > 2007/9/24, Aurelien Jacobs <aurel at gnuage.org>:
> > > On Mon, 24 Sep 2007 20:14:36 +0700
> > > "Vladimir Voroshilov" <voroshil at gmail.com> wrote:

 [...]

> > Index: mplayer/libavformat/avidec.c
> > ===================================================================
> > --- mplayer/libavformat/avidec.c      (revision 10543)
> > +++ mplayer/libavformat/avidec.c      (working copy)
> > @@ -86,7 +86,8 @@
> >      if(tag == MKTAG('A', 'V', 'I', 0x19))
> >          av_log(NULL, AV_LOG_INFO, "file has been generated with a totally broken muxer\n"); else
> > -    if (tag != MKTAG('A', 'V', 'I', ' ') && tag != MKTAG('A', 'V', 'I', 'X'))
> > +    if (tag != MKTAG('A', 'V', 'I', ' ') && tag != MKTAG('A', 'V', 'I', 'X')
> > +    && tag != MKTAG('A', 'M', 'V', ' '))
>
> Alignment is not nice. Maybe use something like this:
>
> +    if (   tag != MKTAG('A', 'V', 'I', ' ') && tag != MKTAG('A', 'V', 'I', 'X')
> +        && tag != MKTAG('A', 'M', 'V', ' '))
>
> > @@ -265,6 +268,8 @@
> >              avi->is_odml = 1;
> >              url_fskip(pb, size + (size & 1));
> >              break;
> > +        case MKTAG('a', 'm', 'v', 'h'):
> > +         amv_file_format=1;
>
> Bad indentation (TABs are forbidden, and there are more of them
> in your patch).
>
> > @@ -298,6 +306,16 @@
> >                      goto fail;
> >                  st->priv_data = ast;
> >              }
> > +            if(amv_file_format){
> > +             switch(stream_index){
> > +             case 0:
> > +                 tag1=MKTAG('v','i','d','s');
> > +                 break;
> > +             case 1:
> > +                 tag1=MKTAG('a','u','d','s');
> > +                 break;
> > +             }
> > +         }
>
> (some more TABs...)

all above issues fixed

> I haven't checked the surrounding code but if stream_index can
> only be 0 or 1, you can replace your whole switch() by:
>
>   tag1 = stream_index ? MKTAG('a','u','d','s') : MKTAG('v','i','d','s');

I have no info about streams count, so kept as is

> I'm not really sure about this issue, but my guess is that either:
>   - AMVV is a normal AVI fourcc, then it should be placed in riff.c
>     (and you should probably use codec_get_id())
>   - AMVV is *not* a normal fourcc, then you shouldn't set codec_tag
>     at all (see: http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2007-September/035453.html )
>

Fake fourcc code removed.
I've also changed CODEC_ID_ADPCM_IMA_WS to CODEC_ID_ADPCM_IMA_AMV,
thus Vitor's patch is required too (his codec provides better sound).

-- 
Regards,
Vladimir Voroshilov     mailto:voroshil at gmail.com
JID: voroshil at gmail.com, voroshil at jabber.ru
ICQ: 95587719
-------------- next part --------------
A non-text attachment was scrubbed...
Name: amv_demux_ffmpeg4.patch
Type: text/x-diff
Size: 3584 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070925/03fc6aef/attachment.patch>



More information about the ffmpeg-devel mailing list