[FFmpeg-cvslog] fftools/ffmpeg: drop always-true conditions

Anton Khirnov git at videolan.org
Tue Oct 4 12:56:31 EEST 2022


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sun Sep  4 12:12:09 2022 +0200| [7a994c87011b336899078d30d4877d59def6d7c6] | committer: Anton Khirnov

fftools/ffmpeg: drop always-true conditions

in_picture->pts cannot be AV_NOPTS_VALUE, as it is set to ost->sync_opts
a few lines above. ost->sync_opts is never AV_NOPTS_VALUE.

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

 fftools/ffmpeg.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index f84701ec75..2054271c82 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -1291,12 +1291,10 @@ static void do_video_out(OutputFile *of,
         in_picture->quality = enc->global_quality;
         in_picture->pict_type = 0;
 
-        if (ost->forced_kf_ref_pts == AV_NOPTS_VALUE &&
-            in_picture->pts != AV_NOPTS_VALUE)
+        if (ost->forced_kf_ref_pts == AV_NOPTS_VALUE)
             ost->forced_kf_ref_pts = in_picture->pts;
 
-        pts_time = in_picture->pts != AV_NOPTS_VALUE ?
-            (in_picture->pts - ost->forced_kf_ref_pts) * av_q2d(enc->time_base) : NAN;
+        pts_time = (in_picture->pts - ost->forced_kf_ref_pts) * av_q2d(enc->time_base);
         if (ost->forced_kf_index < ost->forced_kf_count &&
             in_picture->pts >= ost->forced_kf_pts[ost->forced_kf_index]) {
             ost->forced_kf_index++;



More information about the ffmpeg-cvslog mailing list