diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/player.cc | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index ee044e4e1..af2e6216a 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -209,18 +209,20 @@ Player::pass () } break; } - - Time audio_done_up_to = TIME_MAX; - for (list<shared_ptr<Piece> >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) { - if (dynamic_pointer_cast<AudioDecoder> ((*i)->decoder)) { - audio_done_up_to = min (audio_done_up_to, (*i)->audio_position); - } - } - TimedAudioBuffers<Time> tb = _audio_merger.pull (audio_done_up_to); - Audio (tb.audio, tb.time); - _audio_position += _film->audio_frames_to_time (tb.audio->frames ()); + if (_audio) { + Time audio_done_up_to = TIME_MAX; + for (list<shared_ptr<Piece> >::iterator i = _pieces.begin(); i != _pieces.end(); ++i) { + if (dynamic_pointer_cast<AudioDecoder> ((*i)->decoder)) { + audio_done_up_to = min (audio_done_up_to, (*i)->audio_position); + } + } + TimedAudioBuffers<Time> tb = _audio_merger.pull (audio_done_up_to); + Audio (tb.audio, tb.time); + _audio_position += _film->audio_frames_to_time (tb.audio->frames ()); + } + #ifdef DEBUG_PLAYER cout << "\tpost pass _video_position=" << _video_position << " _audio_position=" << _audio_position << "\n"; #endif |
