projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
081ab0a
)
Fix crash due to alpha_blend requiring BGRA (#1165).
author
Carl Hetherington
<cth@carlh.net>
Thu, 11 Jan 2018 00:58:33 +0000
(
00:58
+0000)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 11 Jan 2018 00:58:33 +0000
(
00:58
+0000)
src/lib/ffmpeg_decoder.cc
patch
|
blob
|
history
diff --git
a/src/lib/ffmpeg_decoder.cc
b/src/lib/ffmpeg_decoder.cc
index 26b1d4bf8081b7dc1e536c2b0473c919721f9398..2f46f17c649c21b32a97ebcd3936bbec5d612750 100644
(file)
--- a/
src/lib/ffmpeg_decoder.cc
+++ b/
src/lib/ffmpeg_decoder.cc
@@
-595,10
+595,10
@@
FFmpegDecoder::decode_subtitle_packet ()
void
FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime from)
{
void
FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime from)
{
- /* Note
RGBA is expressed little-endian, so the first byte in the word is R
, second
- G, third
B
, fourth A.
+ /* Note
BGRA is expressed little-endian, so the first byte in the word is B
, second
+ G, third
R
, fourth A.
*/
*/
- shared_ptr<Image> image (new Image (AV_PIX_FMT_
RGB
A, dcp::Size (rect->w, rect->h), true));
+ shared_ptr<Image> image (new Image (AV_PIX_FMT_
BGR
A, dcp::Size (rect->w, rect->h), true));
#ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT
/* Start of the first line in the subtitle */
#ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT
/* Start of the first line in the subtitle */
@@
-642,8
+642,8
@@
FFmpegDecoder::decode_bitmap_subtitle (AVSubtitleRect const * rect, ContentTime
uint32_t* out_line_p = out_p;
for (int x = 0; x < rect->w; ++x) {
RGBA const p = mapped_palette[*sub_line_p++];
uint32_t* out_line_p = out_p;
for (int x = 0; x < rect->w; ++x) {
RGBA const p = mapped_palette[*sub_line_p++];
- /* XXX: this seems to be wrong to me (isn't the output image
RGB
A?) but it looks right on screen */
- *out_line_p++ = (p.a << 24) | (p.
r << 16) | (p.g << 8) | p.b
;
+ /* XXX: this seems to be wrong to me (isn't the output image
BGR
A?) but it looks right on screen */
+ *out_line_p++ = (p.a << 24) | (p.
b << 16) | (p.g << 8) | p.r
;
}
#ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT
sub_p += rect->pict.linesize[0];
}
#ifdef DCPOMATIC_HAVE_AVSUBTITLERECT_PICT
sub_p += rect->pict.linesize[0];