Prevent assertion failure when using DCP content with no audio.
[dcpomatic.git] / src / lib / player.cc
index 1a008eebb9abc5da060221443a671109ab57957a..32892054918ee412961a792e69688d87bb66665a 100644 (file)
@@ -449,6 +449,11 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate)
 
                BOOST_FOREACH (AudioStreamPtr j, content->audio_streams ()) {
 
+                       if (j->channels() == 0) {
+                               /* Some content (e.g. DCPs) can have streams with no channels */
+                               continue;
+                       }
+
                        /* Audio from this piece's decoder stream (which might be more or less than what we asked for) */
                        ContentAudio all = decoder->get_audio (j, content_frame, request_frames, accurate);