mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-17 04:17:05 +00:00
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 1e5271a9fd
)
This commit is contained in:
parent
a248117f26
commit
115efdefc5
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user