diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-06-19 22:45:18 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-06-30 00:53:20 +0200 |
| commit | f49a724918ad3d1082384576960b1098d7f15822 (patch) | |
| tree | bd916c940758afb152a67ac55699501cc98c4324 /src/lib/audio_decoder.cc | |
| parent | 92858c0cc30fed42119ac632988c8106155e1949 (diff) | |
Use the resampled rate to calculate the slack threshold rather than just 48kHz (#2275).
Diffstat (limited to 'src/lib/audio_decoder.cc')
| -rw-r--r-- | src/lib/audio_decoder.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/audio_decoder.cc b/src/lib/audio_decoder.cc index 664a56c2a..ca1faa010 100644 --- a/src/lib/audio_decoder.cc +++ b/src/lib/audio_decoder.cc @@ -58,17 +58,16 @@ AudioDecoder::emit (shared_ptr<const Film> film, AudioStreamPtr stream, shared_p return; } - /* Amount of error we will tolerate on audio timestamps; see comment below. - * We'll use 1 24fps video frame at 48kHz as this seems to be roughly how - * ffplay does it. - */ - static Frame const slack_frames = 48000 / 24; - int const resampled_rate = _content->resampled_frame_rate(film); if (!time_already_delayed) { time += ContentTime::from_seconds (_content->delay() / 1000.0); } + /* Amount of error we will tolerate on audio timestamps; see comment below. + * We'll use 1 24fps video frame as this seems to be roughly how ffplay does it. + */ + Frame const slack_frames = resampled_rate / 24; + /* first_since_seek is set to true if this is the first data we have received since initialisation or seek. We'll set the position based on the ContentTime that was given. After this first time we just |
