aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-10-27 01:03:19 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-10-27 19:53:11 +0100
commitc08127c5e6922e40ffc4e4f7ad26fd119a8a526f (patch)
tree564f6c6a4b7a1ba91819a69a03efe5dbdb325eb4 /libavformat
parent558c1f35fa09e0f7f67eb27d7c0ff3dd05ba84cd (diff)
downloadffmpeg-c08127c5e6922e40ffc4e4f7ad26fd119a8a526f.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)
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/utils.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index a06ef4377c..7e0476ca5f 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1083,12 +1083,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
}