diff options
| author | Carl Hetherington <cth@carlh.net> | 2014-01-15 21:23:33 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2014-01-15 21:23:33 +0000 |
| commit | 8353a009aae1a604251c0160193c39741c2fa27c (patch) | |
| tree | 558d2b1951f2b4f05f0ab93b46d10afd0ebee929 /src/lib/image_decoder.cc | |
| parent | d0bca7d33b8101cd87f78d5a76b2512dea3988f8 (diff) | |
| parent | 4e5d5c7dcc6470b8dc918d03a00e30c07df60efe (diff) | |
Merge 1.0-seek and subtitle-content.
Diffstat (limited to 'src/lib/image_decoder.cc')
| -rw-r--r-- | src/lib/image_decoder.cc | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/image_decoder.cc b/src/lib/image_decoder.cc index a7999c02a..204849ecf 100644 --- a/src/lib/image_decoder.cc +++ b/src/lib/image_decoder.cc @@ -36,20 +36,22 @@ ImageDecoder::ImageDecoder (shared_ptr<const Film> f, shared_ptr<const ImageCont : Decoder (f) , VideoDecoder (f, c) , _image_content (c) + , _video_position (0) { } -void +bool ImageDecoder::pass () { if (_video_position >= _image_content->video_length ()) { - return; + return true; } if (_image && _image_content->still ()) { video (_image, true, _video_position); - return; + ++_video_position; + return false; } Magick::Image* magick_image = 0; @@ -81,16 +83,15 @@ ImageDecoder::pass () delete magick_image; video (_image, false, _video_position); -} + ++_video_position; -void -ImageDecoder::seek (VideoContent::Frame frame, bool) -{ - _video_position = frame; + return false; } -bool -ImageDecoder::done () const +void +ImageDecoder::seek (ContentTime time, bool accurate) { - return _video_position >= _image_content->video_length (); + Decoder::seek (time, accurate); + + _video_position = rint (time * _video_content->video_frame_rate() / TIME_HZ); } |
