From 253c72987b333a747eeaf25509eb1ec32f484467 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 4 Sep 2015 23:14:46 +0100 Subject: Don't bother with audio in the film viewer. --- src/lib/audio_decoder.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/lib/audio_decoder.cc') diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index a65e5f759..268a9d296 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -32,6 +32,7 @@ using boost::shared_ptr; AudioDecoder::AudioDecoder (shared_ptr content) : _audio_content (content) + , _ignore_audio (false) { BOOST_FOREACH (AudioStreamPtr i, content->audio_streams ()) { _streams[i] = shared_ptr (new AudioDecoderStream (_audio_content, i, this)); @@ -47,6 +48,10 @@ AudioDecoder::get_audio (AudioStreamPtr stream, Frame frame, Frame length, bool void AudioDecoder::audio (AudioStreamPtr stream, shared_ptr data, ContentTime time) { + if (_ignore_audio) { + return; + } + if (_streams.find (stream) == _streams.end ()) { /* This method can be called with an unknown stream during the following sequence: @@ -88,3 +93,10 @@ AudioDecoder::seek (ContentTime t, bool accurate) i->second->seek (t, accurate); } } + +/** Set this player never to produce any audio data */ +void +AudioDecoder::set_ignore_audio () +{ + _ignore_audio = true; +} -- cgit v1.2.3