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
f406dc9c
Commit
f406dc9c
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: restore active style color after hilite
Signed-off-by:
Philip Langdale
<
philipl@overt.org
>
parent
032ad7a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
movtextdec.c
libavcodec/movtextdec.c
+9
-5
No files found.
libavcodec/movtextdec.c
View file @
f406dc9c
...
...
@@ -376,6 +376,7 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
int
text_pos
=
0
;
int
style_active
=
0
;
int
entry
=
0
;
int
color
=
m
->
d
.
color
;
if
(
text
<
text_end
&&
m
->
box_flags
&
TWRP_BOX
)
{
if
(
m
->
w
.
wrap_flag
==
1
)
{
...
...
@@ -404,9 +405,10 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
if
(
m
->
s
[
entry
]
->
style_fontID
==
m
->
ftab
[
i
]
->
fontID
)
av_bprintf
(
buf
,
"{
\\
fn%s}"
,
m
->
ftab
[
i
]
->
font
);
}
if
(
m
->
d
.
color
!=
m
->
s
[
entry
]
->
color
)
av_bprintf
(
buf
,
"{
\\
1c&H%X&}"
,
RGB_TO_BGR
(
m
->
s
[
entry
]
->
color
));
if
(
m
->
d
.
color
!=
m
->
s
[
entry
]
->
color
)
{
color
=
m
->
s
[
entry
]
->
color
;
av_bprintf
(
buf
,
"{
\\
1c&H%X&}"
,
RGB_TO_BGR
(
color
));
}
if
(
m
->
d
.
alpha
!=
m
->
s
[
entry
]
->
alpha
)
av_bprintf
(
buf
,
"{
\\
1a&H%02X&}"
,
255
-
m
->
s
[
entry
]
->
alpha
);
}
...
...
@@ -414,6 +416,7 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
if
(
style_active
)
{
av_bprintf
(
buf
,
"{
\\
r}"
);
style_active
=
0
;
color
=
m
->
d
.
color
;
}
entry
++
;
}
...
...
@@ -435,9 +438,10 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
}
if
(
text_pos
==
m
->
h
.
hlit_end
)
{
if
(
m
->
box_flags
&
HCLR_BOX
)
{
av_bprintf
(
buf
,
"{
\\
2c&H
000000&}"
);
av_bprintf
(
buf
,
"{
\\
2c&H
%X&}"
,
RGB_TO_BGR
(
m
->
d
.
color
)
);
}
else
{
av_bprintf
(
buf
,
"{
\\
1c&HFFFFFF&}{
\\
2c&H000000&}"
);
av_bprintf
(
buf
,
"{
\\
1c&H%X&}{
\\
2c&H%X&}"
,
RGB_TO_BGR
(
color
),
RGB_TO_BGR
(
m
->
d
.
color
));
}
}
}
...
...
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