summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-03-06 22:20:10 +0000
committerCarl Hetherington <cth@carlh.net>2013-03-06 22:20:10 +0000
commitbfea14c1655bc4bbadbe3d9e89f4bd2ddf037659 (patch)
tree1283946cd32ae43f618a9aa7518867abce23583d /src/lib/ffmpeg_decoder.cc
parentbe9c85c16c19b6107c33e23eae1cc9405d5203a2 (diff)
It appears that it may not be just CAP_DELAY decoders that can produce extra frames at the end.
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc38
1 files changed, 16 insertions, 22 deletions
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;
}