From: Carl Hetherington Date: Wed, 6 Mar 2013 22:20:10 +0000 (+0000) Subject: It appears that it may not be just CAP_DELAY decoders that can produce extra frames... X-Git-Tag: v2.0.48~1337^2~347^2~56^2~12 X-Git-Url: https://git.carlh.net/gitweb/?a=commitdiff_plain;h=bfea14c1655bc4bbadbe3d9e89f4bd2ddf037659;p=dcpomatic.git It appears that it may not be just CAP_DELAY decoders that can produce extra frames at the end. --- diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index 30972cbf3..e1834d7f6 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -225,30 +225,24 @@ FFmpegDecoder::pass () _film->log()->log (String::compose (N_("error on av_read_frame (%1) (%2)"), buf, r)); } - if (_video_codec->capabilities & CODEC_CAP_DELAY) { - - /* Get any remaining frames */ - - _packet.data = 0; - _packet.size = 0; - - /* XXX: should we reset _packet.data and size after each *_decode_* call? */ - - int frame_finished; - - if (_opt.decode_video) { - while (avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) { - filter_and_emit_video (); - } - } - - if (_audio_stream && _opt.decode_audio) { - decode_audio_packet (); + /* Get any remaining frames */ + + _packet.data = 0; + _packet.size = 0; + + /* XXX: should we reset _packet.data and size after each *_decode_* call? */ + + int frame_finished; + + if (_opt.decode_video) { + while (avcodec_decode_video2 (_video_codec_context, _frame, &frame_finished, &_packet) >= 0 && frame_finished) { + filter_and_emit_video (); } - } else { - _film->log()->log("Codec does not have CAP_DELAY"); } - + + if (_audio_stream && _opt.decode_audio) { + decode_audio_packet (); + } return true; }