summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2013-08-03 14:05:23 +0100
committerCarl Hetherington <cth@carlh.net>2013-08-03 14:05:23 +0100
commite26396bf15a99a8dc9b17acf7756d7443cc56399 (patch)
treeb24e65908e1242ebe952278414ded2d1000f3349 /src/lib
parentbcb0c2a785a94d7fc278c339d0cc82fead6d2812 (diff)
Only pull audio in pass() if we are handling it.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/player.cc22
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