Revision 6b474953

View differences:

ffmpeg.c
1539 1539
                    decoded_data_size = (ist->st->codec->width * ist->st->codec->height * 3) / 2;
1540 1540
                    /* XXX: allocate picture correctly */
1541 1541
                    avcodec_get_frame_defaults(&picture);
1542
                    ist->st->codec->reordered_opaque = pkt_pts;
1542
                    avpkt.pts = pkt_pts;
1543
                    avpkt.dts = ist->pts;
1543 1544
                    pkt_pts = AV_NOPTS_VALUE;
1544 1545

  
1545 1546
                    ret = avcodec_decode_video2(ist->st->codec,
......
1551 1552
                        /* no picture yet */
1552 1553
                        goto discard_packet;
1553 1554
                    }
1554
                    ist->next_pts = ist->pts = guess_correct_pts(&ist->pts_ctx, picture.reordered_opaque, ist->pts);
1555
                    ist->next_pts = ist->pts = guess_correct_pts(&ist->pts_ctx, picture.pkt_pts, picture.pkt_dts);
1555 1556
                    if (ist->st->codec->time_base.num != 0) {
1556 1557
                        int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
1557 1558
                        ist->next_pts += ((int64_t)AV_TIME_BASE *
ffplay.c
1576 1576

  
1577 1577
    if (got_picture) {
1578 1578
        if (decoder_reorder_pts == -1) {
1579
            *pts = guess_correct_pts(&is->pts_ctx, frame->pkt_pts, pkt->dts);
1579
            *pts = guess_correct_pts(&is->pts_ctx, frame->pkt_pts, frame->pkt_dts);
1580 1580
        } else if (decoder_reorder_pts) {
1581 1581
            *pts = frame->pkt_pts;
1582 1582
        } else {
1583
            *pts = pkt->dts;
1583
            *pts = frame->pkt_dts;
1584 1584
        }
1585 1585

  
1586 1586
        if (*pts == AV_NOPTS_VALUE) {

Also available in: Unified diff