[FFmpeg-devel] [PATCH] improved electronicarts detection

Peter Ross pross
Wed Sep 16 12:36:30 CEST 2009


On Tue, Sep 15, 2009 at 11:36:46AM +0200, Reimar D?ffinger wrote:
> Use the first size field that we already misuse for endianness detection
> for probing. Not much point in trying to support (probably non-existant)
> files that we couldn't even reliably detect the endianness of.
> Surprisingly passes probetest.
> Index: libavformat/electronicarts.c
> ===================================================================
> --- libavformat/electronicarts.c        (revision 19849)
> +++ libavformat/electronicarts.c        (working copy)
> @@ -389,9 +389,13 @@
>      case MPCh_TAG:
>      case MVhd_TAG:
>      case MVIh_TAG:
> -        return AVPROBE_SCORE_MAX;
> +        break;
> +    default:
> +        return 0;
>      }
> -    return 0;
> +    if (AV_RL32(&p->buf[4]) > 0xfffff && AV_RB32(&p->buf[4]) > 0xfffff)
> +        return 0;
> +    return AVPROBE_SCORE_MAX;
>  }
>  
>  static int ea_read_header(AVFormatContext *s,

Looks good.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090916/0fd209b5/attachment.pgp>



More information about the ffmpeg-devel mailing list