summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-07-21 23:34:10 +0000
committerCarl Hetherington <cth@carlh.net>2019-07-21 23:34:10 +0000
commitdcb125a161e62c8936f598c54bfabba20231ff26 (patch)
tree113a9f2de106c2e3dfb55bd4b3a0c29de569e369
parentd6ac233d9bdba4b42ad84fb7e312aad2a367ea77 (diff)
Ignore video streams with frame rates over 1000 (work-around/fix for #1585).
Backported from f4f6a2504e5fedb67513689eaeac9dd88ee38ca9 in 2.15.x.
-rw-r--r--src/lib/ffmpeg.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc
index 8a0dcb593..fb3437910 100644
--- a/src/lib/ffmpeg.cc
+++ b/src/lib/ffmpeg.cc
@@ -159,6 +159,11 @@ FFmpeg::setup_general ()
_video_stream = video_stream_undefined_frame_rate.get();
}
+ /* Ignore video streams with crazy frame rates. These are usually things like album art on MP3s. */
+ if (_video_stream && av_q2d(av_guess_frame_rate(_format_context, _format_context->streams[_video_stream.get()], 0)) > 1000) {
+ _video_stream = optional<int>();
+ }
+
/* Hack: if the AVStreams have duplicate IDs, replace them with our
own. We use the IDs so that we can cope with VOBs, in which streams
move about in index but remain with the same ID in different