diff mbox series

[FFmpeg-devel,2/9] fftools/ffmpeg: drop always-true conditions

Message ID 20220928095556.28209-2-anton@khirnov.net
State Accepted
Commit 7a994c87011b336899078d30d4877d59def6d7c6
Headers show
Series [FFmpeg-devel,1/9] fftools/ffmpeg: drop the -async option | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 fail Make fate failed

Commit Message

Anton Khirnov Sept. 28, 2022, 9:55 a.m. UTC
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.
---
 fftools/ffmpeg.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
diff mbox series

Patch

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