diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-27 01:03:19 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-10-27 19:56:21 +0100 |
commit | 115efdefc5f41449a7862e0689b189fe7e3899cb (patch) | |
tree | e57cd2c058248e3a08d9a38ed920ef58fd9739d3 | |
parent | a248117f2618e9e4de3c87e685bce44578b11657 (diff) | |
download | ffmpeg-115efdefc5f41449a7862e0689b189fe7e3899cb.tar.gz |
avformat/utils: do not override pts in h264 when they are provided from the demuxer
Fixes Ticket2143
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 1e5271a9fd6ddcceb083f2185a4bbd8d44c9a813)
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 3b4ea46a99..f4602dd467 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1032,12 +1032,14 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, if (pkt->dts != AV_NOPTS_VALUE) { // got DTS from the stream, update reference timestamp st->reference_dts = pkt->dts - pc->dts_ref_dts_delta * num / den; - pkt->pts = pkt->dts + pc->pts_dts_delta * num / den; } else if (st->reference_dts != AV_NOPTS_VALUE) { // compute DTS based on reference timestamp pkt->dts = st->reference_dts + pc->dts_ref_dts_delta * num / den; - pkt->pts = pkt->dts + pc->pts_dts_delta * num / den; } + + if (st->reference_dts != AV_NOPTS_VALUE && pkt->pts == AV_NOPTS_VALUE) + pkt->pts = pkt->dts + pc->pts_dts_delta * num / den; + if (pc->dts_sync_point > 0) st->reference_dts = pkt->dts; // new reference } |