]> git.seodisparate.com - EN605.617.81.FA21_StephenSeo_DitheringProject/commitdiff
Fix usage of deprecated AVFrame::pkt_duration
authorStephen Seo <seo.disparate@gmail.com>
Thu, 7 Mar 2024 07:15:19 +0000 (16:15 +0900)
committerStephen Seo <seo.disparate@gmail.com>
Thu, 7 Mar 2024 07:25:31 +0000 (16:25 +0900)
Uses a macro to check FFMpeg version before setting AVFrame::duration or
AVFrame::pkt_duration.

src/video.cc

index 146c5c065e4b0a382048758c28817f6d53f43256..32a5d03f352bf9f2938504812376fd0d2c3a6e6b 100644 (file)
@@ -614,7 +614,11 @@ std::tuple<bool, std::vector<AVFrame *>> Video::HandleDecodingPacket(
       // cleanup
       av_frame_free(&temp_frame);
       yuv_frame->pts = frame_count_ - 1;
+#if LIBAVUTIL_VERSION_INT < AV_VERSION_INT(58, 2, 100)
       yuv_frame->pkt_duration = 1;
+#else
+      yuv_frame->duration = 1;
+#endif
       return_frames.push_back(yuv_frame);
     }  // else (!output_as_pngs)
   }    // while (return_value >= 0)