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
e5b99df0
Commit
e5b99df0
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: only write fontsize, fontID tags if not default
Signed-off-by:
Philip Langdale
<
philipl@overt.org
>
parent
d3c012ff
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
9 deletions
+11
-9
movtextdec.c
libavcodec/movtextdec.c
+11
-9
No files found.
libavcodec/movtextdec.c
View file @
e5b99df0
...
...
@@ -51,8 +51,9 @@
#define RGB_TO_BGR(c) (((c) & 0xff) << 16 | ((c) & 0xff00) | (((c) >> 16) & 0xff))
typedef
struct
{
uint16_t
fontID
;
char
*
font
;
in
t
fontsize
;
uint8_
t
fontsize
;
int
color
;
int
back_color
;
uint8_t
bold
;
...
...
@@ -146,7 +147,6 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
uint8_t
*
tx3g_ptr
=
avctx
->
extradata
;
int
i
,
box_size
,
font_length
;
int8_t
v_align
,
h_align
;
int
style_fontID
;
StyleBox
s_default
;
m
->
count_f
=
0
;
...
...
@@ -192,7 +192,7 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
// StyleRecord
tx3g_ptr
+=
4
;
// fontID
style_
fontID
=
AV_RB16
(
tx3g_ptr
);
m
->
d
.
fontID
=
AV_RB16
(
tx3g_ptr
);
tx3g_ptr
+=
2
;
// face-style-flags
s_default
.
style_flag
=
*
tx3g_ptr
++
;
...
...
@@ -252,7 +252,7 @@ static int mov_text_tx3g(AVCodecContext *avctx, MovTextContext *m)
tx3g_ptr
=
tx3g_ptr
+
font_length
;
}
for
(
i
=
0
;
i
<
m
->
ftab_entries
;
i
++
)
{
if
(
style_
fontID
==
m
->
ftab
[
i
]
->
fontID
)
if
(
m
->
d
.
fontID
==
m
->
ftab
[
i
]
->
fontID
)
m
->
d
.
font
=
m
->
ftab
[
i
]
->
font
;
}
return
0
;
...
...
@@ -385,7 +385,9 @@ static int text_to_ass(AVBPrint *buf, const char *text, const char *text_end,
av_bprintf
(
buf
,
"{
\\
i%d}"
,
m
->
s
[
entry
]
->
italic
);
if
(
m
->
s
[
entry
]
->
underline
^
m
->
d
.
underline
)
av_bprintf
(
buf
,
"{
\\
u%d}"
,
m
->
s
[
entry
]
->
underline
);
if
(
m
->
s
[
entry
]
->
fontsize
!=
m
->
d
.
fontsize
)
av_bprintf
(
buf
,
"{
\\
fs%d}"
,
m
->
s
[
entry
]
->
fontsize
);
if
(
m
->
s
[
entry
]
->
style_fontID
!=
m
->
d
.
fontID
)
for
(
i
=
0
;
i
<
m
->
ftab_entries
;
i
++
)
{
if
(
m
->
s
[
entry
]
->
style_fontID
==
m
->
ftab
[
i
]
->
fontID
)
av_bprintf
(
buf
,
"{
\\
fn%s}"
,
m
->
ftab
[
i
]
->
font
);
...
...
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