From: Carl Hetherington Date: Tue, 11 Jan 2022 15:38:13 +0000 (+0100) Subject: Cleanup: move some stuff into process_video_frame(). X-Git-Tag: v2.15.183~1 X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=84039db657c3cc72719706a136c90741170c765a;ds=sidebyside Cleanup: move some stuff into process_video_frame(). --- diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index e5685f661..f64ccbd3b 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -548,6 +548,15 @@ FFmpegDecoder::decode_and_process_video_packet (AVPacket* packet) throw DecodeError (N_("avcodec_receive_frame"), N_("FFmpeg::decode_and_process_video_packet"), r); } + process_video_frame (); + + return true; +} + + +void +FFmpegDecoder::process_video_frame () +{ /* We assume we'll only get one frame here, which I think is safe */ boost::mutex::scoped_lock lm (_filter_graphs_mutex); @@ -587,8 +596,6 @@ FFmpegDecoder::decode_and_process_video_packet (AVPacket* packet) LOG_WARNING_NC ("Dropping frame without PTS"); } } - - return true; } diff --git a/src/lib/ffmpeg_decoder.h b/src/lib/ffmpeg_decoder.h index fce3fcae9..29e0d22e6 100644 --- a/src/lib/ffmpeg_decoder.h +++ b/src/lib/ffmpeg_decoder.h @@ -62,6 +62,8 @@ private: std::shared_ptr audio_stream_from_index (int index) const; void process_audio_frame (std::shared_ptr stream); + void process_video_frame (); + bool decode_and_process_video_packet (AVPacket* packet); void decode_and_process_audio_packet (AVPacket* packet); void decode_and_process_subtitle_packet (AVPacket* packet);