diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-02-16 21:54:01 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-02-16 21:57:13 +0000 |
| commit | 7147957ea5485a70580135cf32c43a05ed97a7f2 (patch) | |
| tree | 40ccf1d6a8b314ee690a3e9931d94afde3f71de7 | |
| parent | 67e2718f396da6f6faf6f703f6b90162bd6cb9ac (diff) | |
AudioDecoder::_positions is at the resampled rate, if applicable;
fix its initial setup. Fixes problems when seeking deep into
resampled content; before this commit the audio time stamps got
out of whack sufficiently that the butler would fill with video
before any audio made it past the range checks.
| -rw-r--r-- | src/lib/audio_decoder.cc | 2 | ||||
| -rw-r--r-- | src/lib/audio_decoder.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 4bd6535d8..c0f00780a 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -66,7 +66,7 @@ AudioDecoder::emit (AudioStreamPtr stream, shared_ptr<const AudioBuffers> data, silence (_content->delay ()); } time += ContentTime::from_seconds (_content->delay() / 1000.0); - _positions[stream] = time.frames_round (stream->frame_rate ()); + _positions[stream] = time.frames_round (_content->resampled_frame_rate ()); } shared_ptr<Resampler> resampler; diff --git a/src/lib/audio_decoder.h b/src/lib/audio_decoder.h index 69655cceb..d422503a7 100644 --- a/src/lib/audio_decoder.h +++ b/src/lib/audio_decoder.h @@ -60,7 +60,9 @@ private: void silence (int milliseconds); boost::shared_ptr<const AudioContent> _content; - /** Frame after the last one that was emitted from Data for each AudioStream */ + /** Frame after the last one that was emitted from Data (i.e. at the resampled rate, if applicable) + * for each AudioStream. + */ std::map<AudioStreamPtr, Frame> _positions; std::map<AudioStreamPtr, boost::shared_ptr<Resampler> > _resamplers; |
