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
11933017
Commit
11933017
authored
Jul 29, 2017
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc/htmlsubtitles: reindent after previous commits
parent
479ab8c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
40 deletions
+36
-40
htmlsubtitles.c
libavcodec/htmlsubtitles.c
+36
-40
No files found.
libavcodec/htmlsubtitles.c
View file @
11933017
...
...
@@ -177,8 +177,6 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
}
}
// TODO: reindent
if
(
!
av_strcasecmp
(
tagname
,
"font"
))
{
if
(
tag_close
&&
sptr
>
0
)
{
struct
font_tag
*
cur_tag
=
&
stack
[
sptr
--
];
...
...
@@ -209,48 +207,46 @@ int ff_htmlmarkup_to_ass(void *log_ctx, AVBPrint *dst, const char *in)
*
new_tag
=
stack
[
sptr
++
];
while
(
param
)
{
if
(
!
av_strncasecmp
(
param
,
"size="
,
5
))
{
param
+=
5
+
(
param
[
5
]
==
'"'
);
if
(
sscanf
(
param
,
"%u"
,
&
new_tag
->
size
)
==
1
)
av_bprintf
(
dst
,
"{
\\
fs%u}"
,
new_tag
->
size
);
}
else
if
(
!
av_strncasecmp
(
param
,
"color="
,
6
))
{
int
color
;
param
+=
6
+
(
param
[
6
]
==
'"'
);
color
=
html_color_parse
(
log_ctx
,
param
);
if
(
color
>=
0
)
{
new_tag
->
color
=
0xff000000
|
color
;
av_bprintf
(
dst
,
"{
\\
c&H%X&}"
,
new_tag
->
color
&
0xffffff
);
}
}
else
if
(
!
av_strncasecmp
(
param
,
"face="
,
5
))
{
param
+=
5
+
(
param
[
5
]
==
'"'
);
len
=
strcspn
(
param
,
param
[
-
1
]
==
'"'
?
"
\"
"
:
" "
);
av_strlcpy
(
new_tag
->
face
,
param
,
FFMIN
(
sizeof
(
new_tag
->
face
),
len
+
1
));
param
+=
len
;
av_bprintf
(
dst
,
"{
\\
fn%s}"
,
new_tag
->
face
);
while
(
param
)
{
if
(
!
av_strncasecmp
(
param
,
"size="
,
5
))
{
param
+=
5
+
(
param
[
5
]
==
'"'
);
if
(
sscanf
(
param
,
"%u"
,
&
new_tag
->
size
)
==
1
)
av_bprintf
(
dst
,
"{
\\
fs%u}"
,
new_tag
->
size
);
}
else
if
(
!
av_strncasecmp
(
param
,
"color="
,
6
))
{
int
color
;
param
+=
6
+
(
param
[
6
]
==
'"'
);
color
=
html_color_parse
(
log_ctx
,
param
);
if
(
color
>=
0
)
{
new_tag
->
color
=
0xff000000
|
color
;
av_bprintf
(
dst
,
"{
\\
c&H%X&}"
,
new_tag
->
color
&
0xffffff
);
}
if
((
param
=
strchr
(
param
,
' '
)))
param
++
;
}
else
if
(
!
av_strncasecmp
(
param
,
"face="
,
5
))
{
param
+=
5
+
(
param
[
5
]
==
'"'
);
len
=
strcspn
(
param
,
param
[
-
1
]
==
'"'
?
"
\"
"
:
" "
);
av_strlcpy
(
new_tag
->
face
,
param
,
FFMIN
(
sizeof
(
new_tag
->
face
),
len
+
1
));
param
+=
len
;
av_bprintf
(
dst
,
"{
\\
fn%s}"
,
new_tag
->
face
);
}
if
((
param
=
strchr
(
param
,
' '
)))
param
++
;
}
}
in
+=
skip
;
}
else
if
(
tagname
[
0
]
&&
!
tagname
[
1
]
&&
strchr
(
"bisu"
,
av_tolower
(
tagname
[
0
])))
{
av_bprintf
(
dst
,
"{
\\
%c%d}"
,
(
char
)
av_tolower
(
tagname
[
0
]),
!
tag_close
);
in
+=
skip
;
}
else
if
(
!
av_strncasecmp
(
tagname
,
"br"
,
2
)
&&
(
!
tagname
[
2
]
||
(
tagname
[
2
]
==
'/'
&&
!
tagname
[
3
])))
{
av_bprintf
(
dst
,
"
\\
N"
);
in
+=
skip
;
}
else
if
(
likely_a_tag
)
{
if
(
!
tag_close
)
// warn only once
av_log
(
log_ctx
,
AV_LOG_WARNING
,
"Unrecognized tag %s
\n
"
,
tagname
);
in
+=
skip
;
}
else
{
av_bprint_chars
(
dst
,
'<'
,
1
);
}
else
if
(
tagname
[
0
]
&&
!
tagname
[
1
]
&&
strchr
(
"bisu"
,
av_tolower
(
tagname
[
0
])))
{
av_bprintf
(
dst
,
"{
\\
%c%d}"
,
(
char
)
av_tolower
(
tagname
[
0
]),
!
tag_close
);
in
+=
skip
;
}
else
if
(
!
av_strncasecmp
(
tagname
,
"br"
,
2
)
&&
(
!
tagname
[
2
]
||
(
tagname
[
2
]
==
'/'
&&
!
tagname
[
3
])))
{
av_bprintf
(
dst
,
"
\\
N"
);
in
+=
skip
;
}
else
if
(
likely_a_tag
)
{
if
(
!
tag_close
)
// warn only once
av_log
(
log_ctx
,
AV_LOG_WARNING
,
"Unrecognized tag %s
\n
"
,
tagname
);
in
+=
skip
;
}
else
{
av_bprint_chars
(
dst
,
'<'
,
1
);
}
}
else
{
av_bprint_chars
(
dst
,
*
in
,
1
);
...
...
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