summaryrefslogtreecommitdiff
path: root/src/lib/audio_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-09-04 23:14:46 +0100
committerCarl Hetherington <cth@carlh.net>2015-09-05 00:25:14 +0100
commit253c72987b333a747eeaf25509eb1ec32f484467 (patch)
tree2918796879f83a74952a2fe6a9f07037d6d88be3 /src/lib/audio_decoder.cc
parentf227d182fa5a829fdeabf9eca8f33da5ce7f4e0d (diff)
Don't bother with audio in the film viewer.
Diffstat (limited to 'src/lib/audio_decoder.cc')
-rw-r--r--src/lib/audio_decoder.cc12
1 files changed, 12 insertions, 0 deletions
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<const AudioContent> content)
: _audio_content (content)
+ , _ignore_audio (false)
{
BOOST_FOREACH (AudioStreamPtr i, content->audio_streams ()) {
_streams[i] = shared_ptr<AudioDecoderStream> (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<const AudioBuffers> 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;
+}