[FFmpeg-cvslog] fftools/ffmpeg: use InputStream.pts as last resort for decoded frame pts

Anton Khirnov git at videolan.org
Thu Apr 13 16:42:54 EEST 2023


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Apr  8 16:22:41 2023 +0200| [380db569287ba99d903b7629f209b9adc7fd2723] | committer: Anton Khirnov

fftools/ffmpeg: use InputStream.pts as last resort for decoded frame pts

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=380db569287ba99d903b7629f209b9adc7fd2723
---

 fftools/ffmpeg.c | 3 +++
 1 file changed, 3 insertions(+)

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);
 



More information about the ffmpeg-cvslog mailing list