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
9e21c898
Commit
9e21c898
authored
Mar 24, 2013
by
Clément Bœsch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavfi/subtitles: use standard options parsing.
parent
06784b73
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
12 deletions
+7
-12
vf_subtitles.c
libavfilter/vf_subtitles.c
+7
-12
No files found.
libavfilter/vf_subtitles.c
View file @
9e21c898
...
@@ -85,17 +85,9 @@ static void ass_log(int ass_level, const char *fmt, va_list args, void *ctx)
...
@@ -85,17 +85,9 @@ static void ass_log(int ass_level, const char *fmt, va_list args, void *ctx)
av_log
(
ctx
,
level
,
"
\n
"
);
av_log
(
ctx
,
level
,
"
\n
"
);
}
}
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
,
const
AVClass
*
class
)
static
av_cold
int
init
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
{
AssContext
*
ass
=
ctx
->
priv
;
AssContext
*
ass
=
ctx
->
priv
;
static
const
char
*
shorthand
[]
=
{
"filename"
,
NULL
};
int
ret
;
ass
->
class
=
class
;
av_opt_set_defaults
(
ass
);
if
((
ret
=
av_opt_set_from_string
(
ass
,
args
,
shorthand
,
"="
,
":"
))
<
0
)
return
ret
;
if
(
!
ass
->
filename
)
{
if
(
!
ass
->
filename
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"No filename provided!
\n
"
);
av_log
(
ctx
,
AV_LOG_ERROR
,
"No filename provided!
\n
"
);
...
@@ -123,7 +115,6 @@ static av_cold void uninit(AVFilterContext *ctx)
...
@@ -123,7 +115,6 @@ static av_cold void uninit(AVFilterContext *ctx)
{
{
AssContext
*
ass
=
ctx
->
priv
;
AssContext
*
ass
=
ctx
->
priv
;
av_opt_free
(
ass
);
if
(
ass
->
track
)
if
(
ass
->
track
)
ass_free_track
(
ass
->
track
);
ass_free_track
(
ass
->
track
);
if
(
ass
->
renderer
)
if
(
ass
->
renderer
)
...
@@ -210,6 +201,8 @@ static const AVFilterPad ass_outputs[] = {
...
@@ -210,6 +201,8 @@ static const AVFilterPad ass_outputs[] = {
{
NULL
}
{
NULL
}
};
};
static
const
char
*
const
shorthand
[]
=
{
"filename"
,
NULL
};
#if CONFIG_ASS_FILTER
#if CONFIG_ASS_FILTER
static
const
AVOption
ass_options
[]
=
{
static
const
AVOption
ass_options
[]
=
{
...
@@ -222,7 +215,7 @@ AVFILTER_DEFINE_CLASS(ass);
...
@@ -222,7 +215,7 @@ AVFILTER_DEFINE_CLASS(ass);
static
av_cold
int
init_ass
(
AVFilterContext
*
ctx
,
const
char
*
args
)
static
av_cold
int
init_ass
(
AVFilterContext
*
ctx
,
const
char
*
args
)
{
{
AssContext
*
ass
=
ctx
->
priv
;
AssContext
*
ass
=
ctx
->
priv
;
int
ret
=
init
(
ctx
,
args
,
&
ass_class
);
int
ret
=
init
(
ctx
,
args
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
...
@@ -247,6 +240,7 @@ AVFilter avfilter_vf_ass = {
...
@@ -247,6 +240,7 @@ AVFilter avfilter_vf_ass = {
.
inputs
=
ass_inputs
,
.
inputs
=
ass_inputs
,
.
outputs
=
ass_outputs
,
.
outputs
=
ass_outputs
,
.
priv_class
=
&
ass_class
,
.
priv_class
=
&
ass_class
,
.
shorthand
=
shorthand
,
};
};
#endif
#endif
...
@@ -273,7 +267,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
...
@@ -273,7 +267,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
AssContext
*
ass
=
ctx
->
priv
;
AssContext
*
ass
=
ctx
->
priv
;
/* Init libass */
/* Init libass */
ret
=
init
(
ctx
,
args
,
&
subtitles_class
);
ret
=
init
(
ctx
,
args
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
ass
->
track
=
ass_new_track
(
ass
->
library
);
ass
->
track
=
ass_new_track
(
ass
->
library
);
...
@@ -371,5 +365,6 @@ AVFilter avfilter_vf_subtitles = {
...
@@ -371,5 +365,6 @@ AVFilter avfilter_vf_subtitles = {
.
inputs
=
ass_inputs
,
.
inputs
=
ass_inputs
,
.
outputs
=
ass_outputs
,
.
outputs
=
ass_outputs
,
.
priv_class
=
&
subtitles_class
,
.
priv_class
=
&
subtitles_class
,
.
shorthand
=
shorthand
,
};
};
#endif
#endif
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