projects
/
dcpomatic.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copyright date fix.
[dcpomatic.git]
/
src
/
lib
/
image_decoder.cc
diff --git
a/src/lib/image_decoder.cc
b/src/lib/image_decoder.cc
index a5ca67e0d95856c4de867b4f5ea70a17a5dd7a6a..5de0c8582facb1aca80ed8d03479bdf2928331d4 100644
(file)
--- a/
src/lib/image_decoder.cc
+++ b/
src/lib/image_decoder.cc
@@
-30,13
+30,11
@@
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)
- , _video_position (0)
{
}
{
}
@@
-44,25
+42,27
@@
ImageDecoder::ImageDecoder (shared_ptr<const Film> f, shared_ptr<const ImageCont
bool
ImageDecoder::pass ()
{
bool
ImageDecoder::pass ()
{
- if (_video_position >= _image_content->video_length
(
)) {
+ if (_video_position >= _image_content->video_length
().frames (_image_content->video_frame_rate ()
)) {
return true;
}
if (_image && _image_content->still ()) {
return true;
}
if (_image && _image_content->still ()) {
- video (_image,
true, _video_position * TIME_HZ / _video_content->video_frame_rate ()
);
+ video (_image,
_video_position
);
++_video_position;
return false;
}
Magick::Image* magick_image = 0;
++_video_position;
return false;
}
Magick::Image* magick_image = 0;
+
boost::filesystem::path const path = _image_content->path (_image_content->still() ? 0 : _video_position);
boost::filesystem::path const path = _image_content->path (_image_content->still() ? 0 : _video_position);
+
try {
magick_image = new Magick::Image (path.string ());
} catch (...) {
throw OpenFileError (path);
}
try {
magick_image = new Magick::Image (path.string ());
} catch (...) {
throw OpenFileError (path);
}
-
lib
dcp::Size size (magick_image->columns(), magick_image->rows());
+ dcp::Size size (magick_image->columns(), magick_image->rows());
_image.reset (new Image (PIX_FMT_RGB24, size, true));
_image.reset (new Image (PIX_FMT_RGB24, size, true));
@@
-82,7
+82,7
@@
ImageDecoder::pass ()
delete magick_image;
delete magick_image;
- video (_image,
false, _video_position * TIME_HZ / _video_content->video_frame_rate ()
);
+ video (_image,
_video_position
);
++_video_position;
return false;
++_video_position;
return false;
@@
-91,7
+91,6
@@
ImageDecoder::pass ()
void
ImageDecoder::seek (ContentTime time, bool accurate)
{
void
ImageDecoder::seek (ContentTime time, bool accurate)
{
- Decoder::seek (time, accurate);
-
- _video_position = rint (time * _video_content->video_frame_rate() / TIME_HZ);
+ VideoDecoder::seek (time, accurate);
+ _video_position = time.frames (_image_content->video_frame_rate ());
}
}