Don't flush audio if Player is not supposed to be playing it.
authorCarl Hetherington <cth@carlh.net>
Mon, 30 Dec 2013 23:52:56 +0000 (23:52 +0000)
committerCarl Hetherington <cth@carlh.net>
Mon, 30 Dec 2013 23:52:56 +0000 (23:52 +0000)
src/lib/player.cc

index 09a4374943a7dabaf189f2e179d13a904aec848a..cacb42651b1656d706773a7b335c21c054af2458 100644 (file)
@@ -375,16 +375,16 @@ void
 Player::flush ()
 {
        TimedAudioBuffers<Time> tb = _audio_merger.flush ();
-       if (tb.audio) {
+       if (_audio && tb.audio) {
                Audio (tb.audio, tb.time);
                _audio_position += _film->audio_frames_to_time (tb.audio->frames ());
        }
 
-       while (_video_position < _audio_position) {
+       while (_video && _video_position < _audio_position) {
                emit_black ();
        }
 
-       while (_audio_position < _video_position) {
+       while (_audio && _audio_position < _video_position) {
                emit_silence (_film->time_to_audio_frames (_video_position - _audio_position));
        }