Ticket #2106: patchavidavc50.diff

File patchavidavc50.diff, 1.4 KB (added by Carl Eugen Hoyos, 14 years ago)
  • libavformat/mov.c

    diff --git a/libavformat/mov.c b/libavformat/mov.c
    index 6c78adb..9b15cb3 100644
    a b static int mov_read_jp2h(MOVContext *c, AVIOContext *pb, MOVAtom atom)  
    10091009    return mov_read_extradata(c, pb, atom, AV_CODEC_ID_JPEG2000);
    10101010}
    10111011
     1012static int mov_read_ares(MOVContext *c, AVIOContext *pb, MOVAtom atom)
     1013{
     1014    AVCodecContext *codec = c->fc->streams[c->fc->nb_streams-1]->codec;
     1015    if (codec->codec_tag == MKTAG('A', 'V', 'i', 'n') &&
     1016        codec->codec_id == AV_CODEC_ID_H264 &&
     1017        atom.size > 11) {
     1018        avio_skip(pb, 10);
     1019        /* For AVID AVCI50, force width of 1440 to be able to select the correct SPS */
     1020        if (avio_rb16(pb) == 0xd4d)
     1021            codec->width = 1440;
     1022        return 0;
     1023    }
     1024
     1025    return mov_read_extradata(c, pb, atom, AV_CODEC_ID_AVUI);
     1026}
     1027
    10121028static int mov_read_avid(MOVContext *c, AVIOContext *pb, MOVAtom atom)
    10131029{
    10141030    return mov_read_extradata(c, pb, atom, AV_CODEC_ID_AVUI);
    static const MOVParseTableEntry mov_default_parse_table[] = {  
    27172733{ MKTAG('A','C','L','R'), mov_read_avid },
    27182734{ MKTAG('A','P','R','G'), mov_read_avid },
    27192735{ MKTAG('A','A','L','P'), mov_read_avid },
    2720 { MKTAG('A','R','E','S'), mov_read_avid },
     2736{ MKTAG('A','R','E','S'), mov_read_ares },
    27212737{ MKTAG('a','v','s','s'), mov_read_avss },
    27222738{ MKTAG('c','h','p','l'), mov_read_chpl },
    27232739{ MKTAG('c','o','6','4'), mov_read_stco },