diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-09-14 19:46:44 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-09-14 19:47:41 +0200 |
commit | e2d643efcd0570b3ee9668024dbe008b9161de58 (patch) | |
tree | a1eecbe39daa5599b9ef17140a0ca37674f379d3 | |
parent | 509f502902e3760358d5c0c189f3d288652406e5 (diff) | |
download | ffmpeg-e2d643efcd0570b3ee9668024dbe008b9161de58.tar.gz |
lavf/compute_pkt_fields: only run pts by duration correction if reference ts is available
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 7527784742..c6a9e58305 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1114,7 +1114,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, pkt->duration ) { int duration = pkt->duration; - if(pkt->pts != AV_NOPTS_VALUE && duration){ + if(st->cur_dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && duration){ int64_t old_diff= FFABS(st->cur_dts - duration - pkt->pts); int64_t new_diff= FFABS(st->cur_dts - pkt->pts); if( old_diff < new_diff && old_diff < (duration>>3) |