mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
lavf/compute_pkt_fields: only run pts by duration correction if reference ts is available
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
509f502902
commit
e2d643efcd
@ -1114,7 +1114,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
|
||||
pkt->duration ) {
|
||||
int duration = pkt->duration;
|
||||
|
||||
if(pkt->pts != AV_NOPTS_VALUE && duration){
|
||||
if(st->cur_dts != AV_NOPTS_VALUE && pkt->pts != AV_NOPTS_VALUE && duration){
|
||||
int64_t old_diff= FFABS(st->cur_dts - duration - pkt->pts);
|
||||
int64_t new_diff= FFABS(st->cur_dts - pkt->pts);
|
||||
if( old_diff < new_diff && old_diff < (duration>>3)
|
||||
|
Loading…
Reference in New Issue
Block a user