summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2014-01-03 14:06:01 +0000
committerCarl Hetherington <cth@carlh.net>2014-01-03 14:06:01 +0000
commitc3362d7b12e425fa9549579be10e708c88d5feea (patch)
tree42c0698e0d5070bc4c81594fb44f65c4059e5e55 /src
parent43974f2cc0f88118336eece4361ebae20fc12aae (diff)
Fix _audio_position after seek.
Diffstat (limited to 'src')
-rw-r--r--src/lib/audio_decoder.cc4
-rw-r--r--src/lib/player.cc2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc
index d85bfaee2..adabd5d99 100644
--- a/src/lib/audio_decoder.cc
+++ b/src/lib/audio_decoder.cc
@@ -54,7 +54,7 @@ AudioDecoder::audio (shared_ptr<const AudioBuffers> data)
if (_resampler) {
data = _resampler->run (data);
}
-
+
_pending.push_back (shared_ptr<DecodedAudio> (new DecodedAudio (data, _audio_position)));
_audio_position += data->frames ();
}
@@ -80,5 +80,5 @@ AudioDecoder::seek (ContentTime t, bool)
assert (film);
FrameRateChange frc = film->active_frame_rate_change (_audio_content->position ());
- _audio_position = (t + first_audio()) / frc.speed_up;
+ _audio_position = ((t + first_audio()) / frc.speed_up) * film->audio_frame_rate() / TIME_HZ;
}
diff --git a/src/lib/player.cc b/src/lib/player.cc
index da7e7c147..eb7b177ec 100644
--- a/src/lib/player.cc
+++ b/src/lib/player.cc
@@ -121,7 +121,7 @@ Player::pass ()
dec->set_dcp_times (_film->video_frame_rate(), _film->audio_frame_rate(), (*i)->frc, offset);
DCPTime const t = dec->dcp_time - offset;
- if (t >= (*i)->content->full_length() - (*i)->content->trim_end ()) {
+ if (t >= ((*i)->content->full_length() - (*i)->content->trim_end ())) {
/* In the end-trimmed part; decoder has nothing else to give us */
dec.reset ();
done = true;