From 0e2c7f060529d93035e89b06d4aa687830a5e0ad Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 22 Oct 2013 16:48:45 +0100 Subject: Hacks. --- src/lib/audio_decoder.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/lib/audio_decoder.cc') 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 film) +AudioDecoder::AudioDecoder (shared_ptr film, shared_ptr content) : Decoder (film) + , _audio_content (content) , _audio_position (0) { @@ -45,3 +46,12 @@ AudioDecoder::audio (shared_ptr 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; +} -- cgit v1.2.3