Revision a74008a4 libavformat/utils.c

View differences:

libavformat/utils.c
584 584
                               AVCodecParserContext *pc, AVPacket *pkt)
585 585
{
586 586
    int num, den, presentation_delayed, delay, i;
587
    int64_t offset;
587 588
    /* handle wrapping */
588 589
    if(st->cur_dts != AV_NOPTS_VALUE){
589 590
        if(pkt->pts != AV_NOPTS_VALUE)
......
599 600
        }
600 601
    }
601 602

  
603
    /* correct timestamps with byte offset if demuxers only have timestamps on packet boundaries */
604
    if(pc && st->need_parsing == AVSTREAM_PARSE_TIMESTAMPS && pkt->size){
605
        /* this will estimate bitrate based on this frame's duration and size */
606
        offset = av_rescale(pc->offset, pkt->duration, pkt->size);
607
        if(pkt->pts != AV_NOPTS_VALUE)
608
            pkt->pts += offset;
609
        if(pkt->dts != AV_NOPTS_VALUE)
610
            pkt->dts += offset;
611
    }
612

  
602 613
    if(is_intra_only(st->codec))
603 614
        pkt->flags |= PKT_FLAG_KEY;
604 615

  

Also available in: Unified diff