+ BOOST_FOREACH (AudioStreamPtr i, content->audio_streams ()) {
+ _streams[i] = shared_ptr<AudioDecoderStream> (new AudioDecoderStream (_audio_content, i, this));
+ }
+}
+
+ContentAudio
+AudioDecoder::get_audio (AudioStreamPtr stream, Frame frame, Frame length, bool accurate)
+{
+ return _streams[stream]->get (frame, length, accurate);
+}
+
+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:
+ - Add KDM to some DCP content.
+ - Content gets re-examined.
+ - SingleStreamAudioContent::take_from_audio_examiner creates a new stream.
+ - Some content property change signal is delivered so Player::Changed is emitted.
+ - Film viewer to re-gets the frame.
+ - Player calls DCPDecoder pass which calls this method on the new stream.