Revision fb4a4a56 libavcodec/mpeg12.c

View differences:

libavcodec/mpeg12.c
1283 1283
        s->frame_rate = (s->frame_rate * frame_rate_ext_n) / frame_rate_ext_d;
1284 1284
    dprintf("sequence extension\n");
1285 1285
    s->mpeg2 = 1;
1286
    s->avctx->sub_id = 2; /* indicates mpeg2 found */
1286 1287
}
1287 1288

  
1288 1289
static void mpeg_decode_quant_matrix_extension(MpegEncContext *s)
......
1472 1473
    Mpeg1Context *s1 = avctx->priv_data;
1473 1474
    MpegEncContext *s = &s1->mpeg_enc_ctx;
1474 1475
    int width, height, i, v, j;
1475
    
1476

  
1476 1477
    init_get_bits(&s->gb, buf, buf_size);
1477 1478

  
1478 1479
    width = get_bits(&s->gb, 12);
......
1500 1501
        s->avctx = avctx;
1501 1502
        avctx->width = width;
1502 1503
        avctx->height = height;
1503
        avctx->frame_rate = frame_rate_tab[s->frame_rate_index];
1504
        if (s->frame_rate_index >= 9) {
1505
            /* at least give a valid frame rate (some old mpeg1 have this) */
1506
            avctx->frame_rate = 25 * FRAME_RATE_BASE;
1507
        } else {
1508
            avctx->frame_rate = frame_rate_tab[s->frame_rate_index];
1509
        }
1504 1510
        s->frame_rate = avctx->frame_rate;
1505 1511
        avctx->bit_rate = s->bit_rate;
1506 1512
        
......
1561 1567
    s->picture_structure = PICT_FRAME;
1562 1568
    s->frame_pred_frame_dct = 1;
1563 1569
    s->mpeg2 = 0;
1570
    avctx->sub_id = 1; /* indicates mpeg1 */
1564 1571
    return 0;
1565 1572
}
1566 1573

  

Also available in: Unified diff