projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.
[dcpomatic.git]
/
src
/
lib
/
image_decoder.cc
diff --git
a/src/lib/image_decoder.cc
b/src/lib/image_decoder.cc
index 7a9acd9e4960e611bda76e912e4837738e94dc59..d3cdbd6f1ee753b994919cd677828662c1b96a8e 100644
(file)
--- a/
src/lib/image_decoder.cc
+++ b/
src/lib/image_decoder.cc
@@
-31,43
+31,35
@@
using std::cout;
using boost::shared_ptr;
using std::cout;
using boost::shared_ptr;
-using
lib
dcp::Size;
+using dcp::Size;
-ImageDecoder::ImageDecoder (shared_ptr<const Film> f, shared_ptr<const ImageContent> c)
- : Decoder (f)
- , VideoDecoder (f, c)
+ImageDecoder::ImageDecoder (shared_ptr<const ImageContent> c)
+ : VideoDecoder (c)
, _image_content (c)
{
}
, _image_content (c)
{
}
-void
+bool
ImageDecoder::pass ()
{
ImageDecoder::pass ()
{
- if (_video_position >= _image_content->video_length
(
)) {
- return;
+ if (_video_position >= _image_content->video_length
().frames (_image_content->video_frame_rate ()
)) {
+ return
true
;
}
}
- if (
_image && _image_content->still ()
) {
- video (_image, true, _video_position);
-
return
;
+ if (
!_image_content->still() || !_image
) {
+ /* Either we need an image or we are using moving images, so load one */
+
_image.reset (new MagickImageProxy (_image_content->path (_image_content->still() ? 0 : _video_position), _image_content->film()->log ()))
;
}
}
-
- shared_ptr<const Film> film = _film.lock ();
- assert (film);
-
- _image.reset (new MagickImageProxy (_image_content->path (_image_content->still() ? 0 : _video_position), film->log ()));
- video (_image, false, _video_position);
+
+ video (_image, _video_position);
+ ++_video_position;
+ return false;
}
void
}
void
-ImageDecoder::seek (VideoContent::Frame frame, bool)
-{
- _video_position = frame;
-}
-
-bool
-ImageDecoder::done () const
+ImageDecoder::seek (ContentTime time, bool accurate)
{
{
- return _video_position >= _image_content->video_length ();
+ VideoDecoder::seek (time, accurate);
+ _video_position = time.frames (_image_content->video_frame_rate ());
}
}