aboutsummaryrefslogtreecommitdiffstats
path: root/fftools/ffmpeg.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-04-08 16:22:41 +0200
committerAnton Khirnov <anton@khirnov.net>2023-04-13 15:34:07 +0200
commit380db569287ba99d903b7629f209b9adc7fd2723 (patch)
tree5ea0d05357c26563cb6b0c58a9f6b6f3023fae53 /fftools/ffmpeg.c
parent95fa4edbd668971df7c815610b1c263793043e27 (diff)
downloadffmpeg-380db569287ba99d903b7629f209b9adc7fd2723.tar.gz
fftools/ffmpeg: use InputStream.pts as last resort for decoded frame pts
Diffstat (limited to 'fftools/ffmpeg.c')
-rw-r--r--fftools/ffmpeg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 379f6c73cd..741448c29a 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1371,6 +1371,9 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output, int64_
ist->nb_dts_buffer--;
}
+ if (best_effort_timestamp == AV_NOPTS_VALUE)
+ best_effort_timestamp = av_rescale_q(ist->pts, AV_TIME_BASE_Q, ist->st->time_base);
+
if(best_effort_timestamp != AV_NOPTS_VALUE) {
int64_t ts = av_rescale_q(decoded_frame->pts = best_effort_timestamp, ist->st->time_base, AV_TIME_BASE_Q);