diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-07-15 00:53:10 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-07-15 00:53:10 +0100 |
| commit | a788f3c1e29a6b8329d54e1518f3b84d68d347d5 (patch) | |
| tree | 80c0f7a7f46934dfc2834a331d2d04c9eb22cf4b /src/lib/player.cc | |
| parent | 1ba6c53ea04e6c0d61423e3345178ab41ec5f98f (diff) | |
Fix confusion about what dcp_to_content_audio should be doing.
Diffstat (limited to 'src/lib/player.cc')
| -rw-r--r-- | src/lib/player.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index a289c3d92..bc13d6ab2 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -464,9 +464,9 @@ Player::get_audio (DCPTime time, DCPTime length, bool accurate) request = DCPTime (); } - BOOST_FOREACH (AudioStreamPtr j, content->audio_streams ()) { + Frame const content_frame = dcp_to_resampled_audio (*i, request); - Frame const content_frame = dcp_to_content_audio (*i, j, request); + BOOST_FOREACH (AudioStreamPtr j, content->audio_streams ()) { if (j->channels() == 0) { /* Some content (e.g. DCPs) can have streams with no channels */ @@ -536,11 +536,11 @@ Player::content_video_to_dcp (shared_ptr<const Piece> piece, Frame f) const } Frame -Player::dcp_to_content_audio (shared_ptr<const Piece> piece, AudioStreamPtr stream, DCPTime t) const +Player::dcp_to_resampled_audio (shared_ptr<const Piece> piece, DCPTime t) const { - DCPTime s = t - piece->content->position (); - s = min (piece->content->length_after_trim(), s); - return max (ContentTime (), ContentTime (s, piece->frc) + piece->content->trim_start ()).frames (stream->frame_rate ()); + DCPTime s = t - piece->content->position () + DCPTime (piece->content->trim_start (), piece->frc); + s = max (DCPTime (), min (piece->content->length_after_trim(), s)); + return s.frames (_film->audio_frame_rate ()); } ContentTime |
