Revision 58a83023 libavformat/mxfenc.c

View differences:

libavformat/mxfenc.c
1308 1308
    for(i = 0; i < pkt->size - 4; i++) {
1309 1309
        c = (c<<8) + pkt->data[i];
1310 1310
        if (c == 0x1B5) {
1311
            if (i + 2 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x10) { // seq ext
1311
            if ((pkt->data[i+1] & 0xf0) == 0x10) { // seq ext
1312 1312
                st->codec->profile = pkt->data[i+1] & 0x07;
1313 1313
                st->codec->level   = pkt->data[i+2] >> 4;
1314 1314
            } else if (i + 5 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x80) { // pict coding ext
......
1316 1316
                break;
1317 1317
            }
1318 1318
        } else if (c == 0x1b8) { // gop
1319
            if (i + 4 < pkt->size) {
1320 1319
                if (pkt->data[i+4]>>6 & 0x01) // closed
1321 1320
                    *flags |= 0x80; // random access
1322 1321
                if (!mxf->header_written) {
......
1334 1333
                    av_log(s, AV_LOG_DEBUG, "frame %d %d:%d:%d%c%d\n", mxf->timecode_start,
1335 1334
                           hours, minutes, seconds, mxf->timecode_drop_frame ? ';':':', frames);
1336 1335
                }
1337
            }
1338 1336
        } else if (c == 0x1b3) { // seq
1339 1337
            *flags |= 0x40;
1340
            if (i + 4 < pkt->size) {
1341 1338
                switch ((pkt->data[i+4]>>4) & 0xf) {
1342 1339
                case 2:  sc->aspect_ratio = (AVRational){  4,  3}; break;
1343 1340
                case 3:  sc->aspect_ratio = (AVRational){ 16,  9}; break;
......
1346 1343
                    av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
1347 1344
                              st->codec->width, st->codec->height, 1024*1024);
1348 1345
                }
1349
            }
1350 1346
        } else if (c == 0x100) { // pic
1351 1347
            int pict_type = (pkt->data[i+2]>>3) & 0x07;
1352 1348
            if (pict_type == 2) { // P frame

Also available in: Unified diff