summaryrefslogtreecommitdiff
path: root/src/lib/ffmpeg_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-06-01 00:27:57 +0100
committerCarl Hetherington <cth@carlh.net>2019-06-01 00:27:57 +0100
commitb68fb4c103b5580509070c7733d3ae7deb46c3ce (patch)
tree32f0c602e1ff5666d6c7dde77ab0d8bcb56b87ab /src/lib/ffmpeg_decoder.cc
parentdfb23250338ceccbe0fc4e405db6e4df4875a225 (diff)
Basics of allowing video parts of FFmpegContent to be disabled (#1355 and others).
Diffstat (limited to 'src/lib/ffmpeg_decoder.cc')
-rw-r--r--src/lib/ffmpeg_decoder.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc
index c52723da3..cbde534c3 100644
--- a/src/lib/ffmpeg_decoder.cc
+++ b/src/lib/ffmpeg_decoder.cc
@@ -80,7 +80,7 @@ FFmpegDecoder::FFmpegDecoder (shared_ptr<const Film> film, shared_ptr<const FFmp
, Decoder (film)
, _have_current_subtitle (false)
{
- if (c->video) {
+ if (c->video && c->video->use()) {
video.reset (new VideoDecoder (this, c));
_pts_offset = pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->active_video_frame_rate(film));
/* It doesn't matter what size or pixel format this is, it just needs to be black */
@@ -185,7 +185,7 @@ FFmpegDecoder::pass ()
int const si = _packet.stream_index;
shared_ptr<const FFmpegContent> fc = _ffmpeg_content;
- if (_video_stream && si == _video_stream.get() && !video->ignore()) {
+ if (_video_stream && si == _video_stream.get() && video && !video->ignore()) {
decode_video_packet ();
} else if (fc->subtitle_stream() && fc->subtitle_stream()->uses_index(_format_context, si) && !only_text()->ignore()) {
decode_subtitle_packet ();