diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-11-22 02:16:40 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-11-26 00:09:27 +0100 |
| commit | 8dfef0f38cc3323bc4a5d90c9102e8d3965496a4 (patch) | |
| tree | e5852df8f285a1561a6c4737ee6743e29380d3b4 /src/lib | |
| parent | 5799460dc38bafa1da1ce9f7bf43621d3fadf442 (diff) | |
Fix audio glitches when merging resampled audio (#2373).
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/audio_content.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/audio_content.cc b/src/lib/audio_content.cc index 05c388a3e..acd3b81b4 100644 --- a/src/lib/audio_content.cc +++ b/src/lib/audio_content.cc @@ -422,9 +422,11 @@ AudioContent::modify_position (shared_ptr<const Film> film, DCPTime& pos) const void AudioContent::modify_trim_start(shared_ptr<const Film> film, ContentTime& trim) const { - DCPOMATIC_ASSERT (!_streams.empty()); - /* XXX: we're in trouble if streams have different rates */ - trim = trim.round (_streams.front()->frame_rate()); + /* When this trim is used it the audio will have been resampled, and using the + * DCP rate here reduces the chance of rounding errors causing audio glitches + * due to errors in placement of audio frames (#2373). + */ + trim = trim.round(film ? film->audio_frame_rate() : 48000); } |
