Prevent assertion failure when using DCP content with no audio.
authorCarl Hetherington <cth@carlh.net>
Thu, 9 Jul 2015 15:56:38 +0000 (16:56 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 9 Jul 2015 15:56:38 +0000 (16:56 +0100)
ChangeLog
src/lib/player.cc

index 23563601dd0d35ee69755396a36148d7ebf5cf4b..514a1b009dfff4f62ded07c507766db6a3632e09 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2015-07-09  c.hetherington  <cth@carlh.net>
 
+       * Fix error when using DCP content with no audio channels.
+
        * Stop Ctrl+A working when the content tab is not visible (#577).
 
 2015-07-08  c.hetherington  <cth@carlh.net>
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);