aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-27 01:03:19 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-10-27 02:27:45 +0200
commit1e5271a9fd6ddcceb083f2185a4bbd8d44c9a813 (patch)
treec9ab3ab284a91957604dec1ce4987fe5ed783f3c
parentf3d0642d35faf43ce027607bb117142b347ee1a4 (diff)
downloadffmpeg-1e5271a9fd6ddcceb083f2185a4bbd8d44c9a813.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>
-rw-r--r--libavformat/utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index ed307eec0b..77ae7ca038 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1098,12 +1098,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
}