Remove some FFmpeg-related warnings by directly accessing AVFrame.
authorCarl Hetherington <cth@carlh.net>
Wed, 28 Apr 2021 18:14:39 +0000 (20:14 +0200)
committerCarl Hetherington <cth@carlh.net>
Fri, 30 Apr 2021 23:31:57 +0000 (01:31 +0200)
src/lib/ffmpeg_examiner.cc
src/lib/video_filter_graph.cc

index 39951d1..581fead 100644 (file)
@@ -278,9 +278,7 @@ FFmpegExaminer::frame_time (AVStream* s) const
 {
        optional<ContentTime> t;
 
-DCPOMATIC_DISABLE_WARNINGS
-       int64_t const bet = av_frame_get_best_effort_timestamp (_frame);
-DCPOMATIC_ENABLE_WARNINGS
+       int64_t const bet = _frame->best_effort_timestamp;
        if (bet != AV_NOPTS_VALUE) {
                t = ContentTime::from_seconds (bet * av_q2d (s->time_base));
        }
index f114115..c24d967 100644 (file)
@@ -57,9 +57,8 @@ VideoFilterGraph::process (AVFrame* frame)
 {
        list<pair<shared_ptr<Image>, int64_t>> images;
 
-DCPOMATIC_DISABLE_WARNINGS
        if (_copy) {
-               images.push_back (make_pair(make_shared<Image>(frame), av_frame_get_best_effort_timestamp (frame)));
+               images.push_back (make_pair(make_shared<Image>(frame), frame->best_effort_timestamp));
        } else {
                int r = av_buffersrc_write_frame (_buffer_src_context, frame);
                if (r < 0) {
@@ -71,11 +70,10 @@ DCPOMATIC_DISABLE_WARNINGS
                                break;
                        }
 
-                       images.push_back (make_pair(make_shared<Image>(_frame), av_frame_get_best_effort_timestamp (_frame)));
+                       images.push_back (make_pair(make_shared<Image>(_frame), _frame->best_effort_timestamp));
                        av_frame_unref (_frame);
                }
        }
-DCPOMATIC_ENABLE_WARNINGS
 
        return images;
 }