diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-10-22 16:48:45 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-10-22 16:48:45 +0100 |
| commit | 0e2c7f060529d93035e89b06d4aa687830a5e0ad (patch) | |
| tree | 4a4e95373532ed6557d0fabd7c4fd989d9dbc87b /src/lib/audio_decoder.cc | |
| parent | db67e0d5c855127862bb8dd579d41e4a11f84798 (diff) | |
Hacks.
Diffstat (limited to 'src/lib/audio_decoder.cc')
| -rw-r--r-- | src/lib/audio_decoder.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 1f5868583..c9fbddda1 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -32,8 +32,9 @@ using std::cout; using boost::optional; using boost::shared_ptr; -AudioDecoder::AudioDecoder (shared_ptr<const Film> film) +AudioDecoder::AudioDecoder (shared_ptr<const Film> film, shared_ptr<const AudioContent> content) : Decoder (film) + , _audio_content (content) , _audio_position (0) { @@ -45,3 +46,12 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data, AudioContent::Frame fr Audio (data, frame); _audio_position = frame + data->frames (); } + +/** This is a bit odd, but necessary when we have (e.g.) FFmpegDecoders with no audio. + * The player needs to know that there is no audio otherwise it will keep prompting the XXX + */ +bool +AudioDecoder::has_audio () const +{ + return _audio_content->channels () > 0; +} |
