diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2012-04-26 11:02:02 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2012-05-03 16:28:08 -0400 |
commit | 8916f1fbcba0f2a3927752ddd0b6ea6e209c6698 (patch) | |
tree | df490dffbbbf3e24c8310e52713e1c33b3fc7947 /libavformat/utils.c | |
parent | ff499157a11046a59f88646a2541bd6c170f1804 (diff) | |
download | ffmpeg-8916f1fbcba0f2a3927752ddd0b6ea6e209c6698.tar.gz |
avformat: only fill-in interpolated timestamps if duration is non-zero
This avoids returning duplicate timestamps for multiple packets when the
demuxer does not provide all timestamps and packet duration is not known.
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 31708cfaa7..e867b73017 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -985,6 +985,8 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, } } + if (pkt->pts != AV_NOPTS_VALUE || pkt->dts != AV_NOPTS_VALUE || + duration) { /* presentation is not delayed : PTS and DTS are the same */ if(pkt->pts == AV_NOPTS_VALUE) pkt->pts = pkt->dts; @@ -994,6 +996,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, pkt->dts = pkt->pts; if(pkt->pts != AV_NOPTS_VALUE) st->cur_dts = pkt->pts + duration; + } } } |