Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Stebbins <jstebbins@jetheaddev.com>2020-04-04 19:51:04 +0300
committerPhilip Langdale <philipl@overt.org>2020-04-10 19:32:13 +0300
commit47e88adc0dc54250117158dc62e19c1b722f4f01 (patch)
treedc25ebee8719b8f5694a9ce41574829b8f2066de /libavcodec/movtextdec.c
parentc3a2615bb84486fe0267a9c102b4113b38cdbafd (diff)
lavc/movtextdec: fix ass header colors
A conversion from rgb to bgr is necessary Signed-off-by: Philip Langdale <philipl@overt.org>
Diffstat (limited to 'libavcodec/movtextdec.c')
-rw-r--r--libavcodec/movtextdec.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libavcodec/movtextdec.c b/libavcodec/movtextdec.c
index c38c5edce6..05becaf64d 100644
--- a/libavcodec/movtextdec.c
+++ b/libavcodec/movtextdec.c
@@ -48,6 +48,8 @@
#define TOP_CENTER 8
#define TOP_RIGHT 9
+#define RGB_TO_BGR(c) (((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff))
+
typedef struct {
char *font;
int fontsize;
@@ -448,10 +450,11 @@ static int mov_text_init(AVCodecContext *avctx) {
MovTextContext *m = avctx->priv_data;
ret = mov_text_tx3g(avctx, m);
if (ret == 0) {
- return ff_ass_subtitle_header(avctx, m->d.font, m->d.fontsize, m->d.color,
- m->d.back_color, m->d.bold, m->d.italic,
- m->d.underline, ASS_DEFAULT_BORDERSTYLE,
- m->d.alignment);
+ return ff_ass_subtitle_header(avctx, m->d.font, m->d.fontsize,
+ RGB_TO_BGR(m->d.color),
+ RGB_TO_BGR(m->d.back_color),
+ m->d.bold, m->d.italic, m->d.underline,
+ ASS_DEFAULT_BORDERSTYLE, m->d.alignment);
} else
return ff_ass_subtitle_header_default(avctx);
}