summaryrefslogtreecommitdiff
path: root/src/lib/player.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/player.cc
parentf227d182fa5a829fdeabf9eca8f33da5ce7f4e0d (diff)
Don't bother with audio in the film viewer.
Diffstat (limited to 'src/lib/player.cc')
-rw-r--r--src/lib/player.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc
index caa2791b8..5e1fbcc63 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -74,6 +74,7 @@ Player::Player (shared_ptr<const Film> film, shared_ptr<const Playlist> playlist
, _playlist (playlist)
, _have_valid_pieces (false)
, _ignore_video (false)
+ , _ignore_audio (false)
, _always_burn_subtitles (false)
{
_film_changed_connection = _film->Changed.connect (bind (&Player::film_changed, this, _1));
@@ -180,6 +181,11 @@ Player::setup_pieces ()
vd->set_ignore_video ();
}
+ shared_ptr<AudioDecoder> ad = dynamic_pointer_cast<AudioDecoder> (decoder);
+ if (ad && _ignore_audio) {
+ ad->set_ignore_audio ();
+ }
+
_pieces.push_back (shared_ptr<Piece> (new Piece (i, decoder, frc.get ())));
}
@@ -652,6 +658,13 @@ Player::set_ignore_video ()
_ignore_video = true;
}
+/** Set this player never to produce any audio data */
+void
+Player::set_ignore_audio ()
+{
+ _ignore_audio = true;
+}
+
/** Set whether or not this player should always burn text subtitles into the image,
* regardless of the content settings.
* @param burn true to always burn subtitles, false to obey content settings.