Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
91447ae3
Commit
91447ae3
authored
Apr 04, 2020
by
John Stebbins
Committed by
Philip Langdale
Apr 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/movtextdec: add alpha default to ass header colors
Signed-off-by:
Philip Langdale
<
philipl@overt.org
>
parent
c0d3fea6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
movtextdec.c
libavcodec/movtextdec.c
+10
-4
sub-movtext
tests/ref/fate/sub-movtext
+1
-1
No files found.
libavcodec/movtextdec.c
View file @
91447ae3
...
...
@@ -55,7 +55,9 @@ typedef struct {
const
char
*
font
;
uint8_t
fontsize
;
int
color
;
uint8_t
alpha
;
int
back_color
;
uint8_t
back_alpha
;
uint8_t
bold
;
uint8_t
italic
;
uint8_t
underline
;
...
...
@@ -186,7 +188,9 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
}
// Background Color
m
->
d
.
back_color
=
AV_RB24
(
tx3g_ptr
);
tx3g_ptr
+=
4
;
tx3g_ptr
+=
3
;
m
->
d
.
back_alpha
=
AV_RB8
(
tx3g_ptr
);
tx3g_ptr
+=
1
;
// BoxRecord
tx3g_ptr
+=
8
;
// StyleRecord
...
...
@@ -203,7 +207,9 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
m
->
d
.
fontsize
=
*
tx3g_ptr
++
;
// Primary color
m
->
d
.
color
=
AV_RB24
(
tx3g_ptr
);
tx3g_ptr
+=
4
;
tx3g_ptr
+=
3
;
m
->
d
.
alpha
=
AV_RB8
(
tx3g_ptr
);
tx3g_ptr
+=
1
;
// FontRecord
// FontRecord Size
tx3g_ptr
+=
4
;
...
...
@@ -463,8 +469,8 @@ static int mov_text_init(AVCodecContext *avctx) {
ret
=
mov_text_tx3g
(
avctx
,
m
);
if
(
ret
==
0
)
{
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
),
(
255
-
m
->
d
.
alpha
)
<<
24
|
RGB_TO_BGR
(
m
->
d
.
color
),
(
255
-
m
->
d
.
back_alpha
)
<<
24
|
RGB_TO_BGR
(
m
->
d
.
back_color
),
m
->
d
.
bold
,
m
->
d
.
italic
,
m
->
d
.
underline
,
ASS_DEFAULT_BORDERSTYLE
,
m
->
d
.
alignment
);
}
else
...
...
tests/ref/fate/sub-movtext
View file @
91447ae3
...
...
@@ -6,7 +6,7 @@ PlayResY: 288
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Serif,18,&Hffffff,&Hffffff,&H
0,&H
0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0
Style: Default,Serif,18,&Hffffff,&Hffffff,&H
ff000000,&Hff00000
0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,0
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment