Fix crash when changing DCP audio channel count.
authorCarl Hetherington <cth@carlh.net>
Sat, 24 Mar 2018 23:55:56 +0000 (23:55 +0000)
committerCarl Hetherington <cth@carlh.net>
Sat, 24 Mar 2018 23:57:22 +0000 (23:57 +0000)
Without this we ask the AudioMerger to merge new buffers with N
channels with old buffers with M channels, which it can't do.

I'm not convinced this is the best solution but I think it will do
for now.

ChangeLog
src/lib/player.cc

index d6eda2d9178307ceb3f13b6a04300944fe6927c7..0d5a872165dbf9d84a1c76969b4621480939fd03 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2018-03-24  Carl Hetherington  <cth@carlh.net>
 
+       * Fix crash when changing DCP audio channel count (#1253).
+
        * Fix update checker error when there is no test
        version.
 
index bd194c3733dfb05cb267d9af3632d2b542f9245e..6ec593f6c8569e8d5a3d97e4efc113876b0587dd 100644 (file)
@@ -283,6 +283,8 @@ Player::film_changed (Film::Property p)
                if (_film->audio_processor ()) {
                        _audio_processor = _film->audio_processor()->clone (_film->audio_frame_rate ());
                }
+       } else if (p == Film::AUDIO_CHANNELS) {
+               _audio_merger.clear ();
        }
 }