diff options
| author | Carl Hetherington <cth@carlh.net> | 2012-12-18 21:13:10 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2012-12-18 21:13:10 +0000 |
| commit | 0330d9b2924767d9240c5a25e9ed4327eb0a73bd (patch) | |
| tree | c0041d4d64b6cc6b1dc57fd12e23b5ca552197c1 /src/lib/video_decoder.cc | |
| parent | 880719c0bf2f2ce99ca44a5f5289fdd30962246a (diff) | |
Try to tidy up subtitle timing and seeks wrt source frames, DCP frames and rounding.
Diffstat (limited to 'src/lib/video_decoder.cc')
| -rw-r--r-- | src/lib/video_decoder.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/video_decoder.cc b/src/lib/video_decoder.cc index f4501bbf3..e723610b3 100644 --- a/src/lib/video_decoder.cc +++ b/src/lib/video_decoder.cc @@ -31,7 +31,7 @@ using boost::optional; VideoDecoder::VideoDecoder (shared_ptr<Film> f, shared_ptr<const DecodeOptions> o, Job* j) : Decoder (f, o, j) , _video_frame (0) - , _last_source_frame (0) + , _last_source_time (0) { } @@ -39,19 +39,18 @@ VideoDecoder::VideoDecoder (shared_ptr<Film> f, shared_ptr<const DecodeOptions> /** Called by subclasses to tell the world that some video data is ready. * We find a subtitle then emit it for listeners. * @param image frame to emit. - * @param f Frame within the source. + * @param t Time of the frame within the source, in seconds. */ void -VideoDecoder::emit_video (shared_ptr<Image> image, SourceFrame f) +VideoDecoder::emit_video (shared_ptr<Image> image, double t) { shared_ptr<Subtitle> sub; - if (_timed_subtitle && _timed_subtitle->displayed_at (f / _film->frames_per_second())) { - _film->log()->log (String::compose ("putting subtitle using %1 instead of %2", f, video_frame())); + if (_timed_subtitle && _timed_subtitle->displayed_at (t)) { sub = _timed_subtitle->subtitle (); } signal_video (image, sub); - _last_source_frame = f; + _last_source_time = t; } void |
