summaryrefslogtreecommitdiff
path: root/src/lib/render_subtitles.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-01-10 01:00:14 +0000
committerCarl Hetherington <cth@carlh.net>2018-01-10 01:00:14 +0000
commitf59ae2d9793699fd0e18f9e53ff362c26c2ef00c (patch)
tree5e4e1e0bf7872e1c5dd581b5b6cb255d9a20ebb1 /src/lib/render_subtitles.cc
parent1d7a98b5c7537b4874645c56cd83ece9f78625f5 (diff)
Fix yet more pixel order confusions.
Diffstat (limited to 'src/lib/render_subtitles.cc')
-rw-r--r--src/lib/render_subtitles.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/render_subtitles.cc b/src/lib/render_subtitles.cc
index 9c4617ac3..56343cd50 100644
--- a/src/lib/render_subtitles.cc
+++ b/src/lib/render_subtitles.cc
@@ -123,7 +123,8 @@ render_line (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp:
/* ...and add a bit more for luck */
height += target.height / 11;
- shared_ptr<Image> image (new Image (AV_PIX_FMT_RGBA, dcp::Size (target.width, height), false));
+ /* FFmpeg BGRA means first byte blue, second byte green, third byte red, fourth byte alpha */
+ shared_ptr<Image> image (new Image (AV_PIX_FMT_BGRA, dcp::Size (target.width, height), false));
image->make_black ();
#ifdef DCPOMATIC_HAVE_FORMAT_STRIDE_FOR_WIDTH
@@ -132,6 +133,7 @@ render_line (list<SubtitleString> subtitles, list<shared_ptr<Font> > fonts, dcp:
Cairo::FORMAT_ARGB32,
image->size().width,
image->size().height,
+ /* Cairo ARGB32 means first byte blue, second byte green, third byte red, fourth byte alpha */
Cairo::ImageSurface::format_stride_for_width (Cairo::FORMAT_ARGB32, image->size().width)
);
#else