projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3bc7c34
)
Fix incorrect scaling of DVB subtitles when the picture is not 720x576.
author
Carl Hetherington
<cth@carlh.net>
Fri, 18 Nov 2016 21:33:25 +0000
(21:33 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Sat, 19 Nov 2016 00:51:05 +0000
(
00:51
+0000)
src/lib/ffmpeg_decoder.cc
patch
|
blob
|
history
diff --git
a/src/lib/ffmpeg_decoder.cc
b/src/lib/ffmpeg_decoder.cc
index e2c200d7713224ae0c978ca5e8477f8ed4c318df..253272e9638a3387f529b7d5548eff86321ddaf6 100644
(file)
--- a/
src/lib/ffmpeg_decoder.cc
+++ b/
src/lib/ffmpeg_decoder.cc
@@
-612,12
+612,13
@@
FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTimeP
out_p += image->stride()[0] / sizeof (uint32_t);
}
out_p += image->stride()[0] / sizeof (uint32_t);
}
- dcp::Size const vs = _ffmpeg_content->video->size ();
+ int const target_width = subtitle_codec_context()->width;
+ int const target_height = subtitle_codec_context()->height;
dcpomatic::Rect<double> const scaled_rect (
dcpomatic::Rect<double> const scaled_rect (
- static_cast<double> (rect->x) /
vs.
width,
- static_cast<double> (rect->y) /
vs.
height,
- static_cast<double> (rect->w) /
vs.
width,
- static_cast<double> (rect->h) /
vs.
height
+ static_cast<double> (rect->x) /
target_
width,
+ static_cast<double> (rect->y) /
target_
height,
+ static_cast<double> (rect->w) /
target_
width,
+ static_cast<double> (rect->h) /
target_
height
);
subtitle->give_image (period, image, scaled_rect);
);
subtitle->give_image (period, image, scaled_rect);