diff options
Diffstat (limited to 'src/lib/player_video.cc')
| -rw-r--r-- | src/lib/player_video.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/player_video.cc b/src/lib/player_video.cc index 8eb39efed..a50b196a2 100644 --- a/src/lib/player_video.cc +++ b/src/lib/player_video.cc @@ -34,6 +34,7 @@ extern "C" { using std::string; using std::cout; +using std::pair; using boost::shared_ptr; using boost::weak_ptr; using boost::dynamic_pointer_cast; @@ -112,7 +113,9 @@ PlayerVideo::set_subtitle (PositionImage image) shared_ptr<Image> PlayerVideo::image (dcp::NoteHandler note, function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const { - shared_ptr<Image> im = _in->image (optional<dcp::NoteHandler> (note), _inter_size); + pair<shared_ptr<Image>, int> prox = _in->image (optional<dcp::NoteHandler> (note), _inter_size); + shared_ptr<Image> im = prox.first; + int const reduce = prox.second; Crop total_crop = _crop; switch (_part) { @@ -132,6 +135,15 @@ PlayerVideo::image (dcp::NoteHandler note, function<AVPixelFormat (AVPixelFormat break; } + if (reduce > 0) { + /* Scale the crop down to account for the scaling that has already happened in ImageProxy::image */ + int const r = pow(2, reduce); + total_crop.left /= r; + total_crop.right /= r; + total_crop.top /= r; + total_crop.bottom /= r; + } + dcp::YUVToRGB yuv_to_rgb = dcp::YUV_TO_RGB_REC601; if (_colour_conversion) { yuv_to_rgb = _colour_conversion.get().yuv_to_rgb(); |
