mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-28 14:01:27 +00:00
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.
This commit is contained in:
parent
ff499157a1
commit
8916f1fbcb
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user