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
bad953bc
Commit
bad953bc
authored
Sep 22, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: fix overriding codecs with the new syntax
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8364bde0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
0 deletions
+18
-0
ffmpeg_opt.c
ffmpeg_opt.c
+18
-0
No files found.
ffmpeg_opt.c
View file @
bad953bc
...
...
@@ -54,6 +54,17 @@
}\
}
#define MATCH_PER_TYPE_OPT(name, type, outvar, fmtctx, mediatype)\
{\
int i, ret;\
for (i = 0; i < o->nb_ ## name; i++) {\
char *spec = o->name[i].specifier;\
if (!strcmp(spec, mediatype) || !*spec)\
outvar = o->name[i].u.type;\
else if (ret < 0)\
exit_program(1);\
}\
}
char
*
vstats_filename
;
float
audio_drift_threshold
=
0
.
1
;
...
...
@@ -688,6 +699,9 @@ static int opt_input_file(void *optctx, const char *opt, const char *filename)
uint8_t
buf
[
128
];
AVDictionary
**
opts
;
int
orig_nb_streams
;
// number of streams before avformat_find_stream_info
char
*
video_codec_name
=
NULL
;
char
*
audio_codec_name
=
NULL
;
char
*
subtitle_codec_name
=
NULL
;
if
(
o
->
format
)
{
if
(
!
(
file_iformat
=
av_find_input_format
(
o
->
format
)))
{
...
...
@@ -740,6 +754,10 @@ static int opt_input_file(void *optctx, const char *opt, const char *filename)
if
(
o
->
nb_frame_pix_fmts
)
av_dict_set
(
&
format_opts
,
"pixel_format"
,
o
->
frame_pix_fmts
[
o
->
nb_frame_pix_fmts
-
1
].
u
.
str
,
0
);
MATCH_PER_TYPE_OPT
(
codec_names
,
str
,
video_codec_name
,
ic
,
"v"
);
MATCH_PER_TYPE_OPT
(
codec_names
,
str
,
audio_codec_name
,
ic
,
"a"
);
MATCH_PER_TYPE_OPT
(
codec_names
,
str
,
subtitle_codec_name
,
ic
,
"s"
);
ic
->
video_codec_id
=
video_codec_name
?
find_codec_or_die
(
video_codec_name
,
AVMEDIA_TYPE_VIDEO
,
0
)
->
id
:
AV_CODEC_ID_NONE
;
ic
->
audio_codec_id
=
audio_codec_name
?
...
...
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