diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-07-24 22:14:31 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-07-24 22:14:31 +0100 |
| commit | 7ba331621429d3516ba48a4585e58f1f6fa76cdf (patch) | |
| tree | 15a386afd66bf02307f18c9da232387f08aaf835 /src/lib | |
| parent | 5807c8a5f7baec5355a2bae2771f197989001c92 (diff) | |
Fix mistaken clamp to length_after_trim after adding trim_start.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/player.cc | 6 | ||||
| -rw-r--r-- | src/lib/video_decoder.cc | 7 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/player.cc b/src/lib/player.cc index a44d916d8..e73481107 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -538,9 +538,9 @@ Player::content_video_to_dcp (shared_ptr<const Piece> piece, Frame f) const Frame Player::dcp_to_resampled_audio (shared_ptr<const Piece> piece, DCPTime t) const { - 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 ()); + DCPTime s = t - piece->content->position (); + s = min (piece->content->length_after_trim(), s); + return max (DCPTime (), DCPTime (piece->content->trim_start (), piece->frc) + s).frames (_film->audio_frame_rate ()); } ContentTime diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index cdf8bc12a..944b1b695 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -285,14 +285,11 @@ VideoDecoder::video (shared_ptr<const ImageProxy> image, Frame frame) to = to_push.front().frame; } - /* It has been known that this method receives frames out of order; at this - point I'm not sure why, but we'll just ignore them. + /* If we've pre-rolled on a seek we may now receive out-of-order frames + (frames before the last seek time) which we can just ignore. */ if (from && to && from.get() > to.get()) { - _video_content->film()->log()->log ( - String::compose ("Ignoring out-of-order decoded frame %1 after %2", to.get(), from.get()), Log::TYPE_WARNING - ); return; } |
