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
6d13499b
Commit
6d13499b
authored
Nov 27, 2011
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cmdutils: pass AVCodec to filter_codec_opts()
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
e99c4bbd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
10 deletions
+9
-10
avconv.c
avconv.c
+2
-2
cmdutils.c
cmdutils.c
+2
-3
cmdutils.h
cmdutils.h
+1
-1
ffmpeg.c
ffmpeg.c
+2
-2
ffplay.c
ffplay.c
+2
-2
No files found.
avconv.c
View file @
6d13499b
...
...
@@ -2963,7 +2963,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
ist
->
st
=
st
;
ist
->
file_index
=
nb_input_files
;
ist
->
discard
=
1
;
ist
->
opts
=
filter_codec_opts
(
codec_opts
,
ist
->
st
->
codec
->
codec_id
,
ic
,
st
);
ist
->
opts
=
filter_codec_opts
(
codec_opts
,
choose_decoder
(
o
,
ic
,
st
)
,
ic
,
st
);
ist
->
ts_scale
=
1
.
0
;
MATCH_PER_STREAM_OPT
(
ts_scale
,
dbl
,
ist
->
ts_scale
,
ic
,
st
);
...
...
@@ -3302,7 +3302,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
st
->
codec
->
codec_type
=
type
;
choose_encoder
(
o
,
oc
,
ost
);
if
(
ost
->
enc
)
{
ost
->
opts
=
filter_codec_opts
(
codec_opts
,
ost
->
enc
->
id
,
oc
,
st
);
ost
->
opts
=
filter_codec_opts
(
codec_opts
,
ost
->
enc
,
oc
,
st
);
}
avcodec_get_context_defaults3
(
st
->
codec
,
ost
->
enc
);
...
...
cmdutils.c
View file @
6d13499b
...
...
@@ -945,11 +945,10 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
return
AVERROR
(
EINVAL
);
}
AVDictionary
*
filter_codec_opts
(
AVDictionary
*
opts
,
enum
CodecID
codec_id
,
AVFormatContext
*
s
,
AVStream
*
st
)
AVDictionary
*
filter_codec_opts
(
AVDictionary
*
opts
,
AVCodec
*
codec
,
AVFormatContext
*
s
,
AVStream
*
st
)
{
AVDictionary
*
ret
=
NULL
;
AVDictionaryEntry
*
t
=
NULL
;
AVCodec
*
codec
=
s
->
oformat
?
avcodec_find_encoder
(
codec_id
)
:
avcodec_find_decoder
(
codec_id
);
int
flags
=
s
->
oformat
?
AV_OPT_FLAG_ENCODING_PARAM
:
AV_OPT_FLAG_DECODING_PARAM
;
char
prefix
=
0
;
const
AVClass
*
cc
=
avcodec_get_class
();
...
...
@@ -999,7 +998,7 @@ AVDictionary **setup_find_stream_info_opts(AVFormatContext *s, AVDictionary *cod
return
NULL
;
}
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
opts
[
i
]
=
filter_codec_opts
(
codec_opts
,
s
->
streams
[
i
]
->
codec
->
codec_id
,
s
,
s
->
streams
[
i
]);
opts
[
i
]
=
filter_codec_opts
(
codec_opts
,
avcodec_find_decoder
(
s
->
streams
[
i
]
->
codec
->
codec_id
)
,
s
,
s
->
streams
[
i
]);
return
opts
;
}
...
...
cmdutils.h
View file @
6d13499b
...
...
@@ -212,7 +212,7 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
* @param st A stream from s for which the options should be filtered.
* @return a pointer to the created dictionary
*/
AVDictionary
*
filter_codec_opts
(
AVDictionary
*
opts
,
enum
CodecID
codec_id
,
AVFormatContext
*
s
,
AVStream
*
st
);
AVDictionary
*
filter_codec_opts
(
AVDictionary
*
opts
,
AVCodec
*
codec
,
AVFormatContext
*
s
,
AVStream
*
st
);
/**
* Setup AVCodecContext options for avformat_find_stream_info().
...
...
ffmpeg.c
View file @
6d13499b
...
...
@@ -3189,7 +3189,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
ist
->
st
=
st
;
ist
->
file_index
=
nb_input_files
;
ist
->
discard
=
1
;
ist
->
opts
=
filter_codec_opts
(
codec_opts
,
ist
->
st
->
codec
->
codec_id
,
ic
,
st
);
ist
->
opts
=
filter_codec_opts
(
codec_opts
,
choose_decoder
(
o
,
ic
,
st
)
,
ic
,
st
);
ist
->
ts_scale
=
1
.
0
;
MATCH_PER_STREAM_OPT
(
ts_scale
,
dbl
,
ist
->
ts_scale
,
ic
,
st
);
...
...
@@ -3546,7 +3546,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
st
->
codec
->
codec_type
=
type
;
choose_encoder
(
o
,
oc
,
ost
);
if
(
ost
->
enc
)
{
ost
->
opts
=
filter_codec_opts
(
codec_opts
,
ost
->
enc
->
id
,
oc
,
st
);
ost
->
opts
=
filter_codec_opts
(
codec_opts
,
ost
->
enc
,
oc
,
st
);
}
avcodec_get_context_defaults3
(
st
->
codec
,
ost
->
enc
);
...
...
ffplay.c
View file @
6d13499b
...
...
@@ -2217,9 +2217,9 @@ static int stream_component_open(VideoState *is, int stream_index)
return
-
1
;
avctx
=
ic
->
streams
[
stream_index
]
->
codec
;
opts
=
filter_codec_opts
(
codec_opts
,
avctx
->
codec_id
,
ic
,
ic
->
streams
[
stream_index
]);
codec
=
avcodec_find_decoder
(
avctx
->
codec_id
);
opts
=
filter_codec_opts
(
codec_opts
,
codec
,
ic
,
ic
->
streams
[
stream_index
]);
switch
(
avctx
->
codec_type
){
case
AVMEDIA_TYPE_AUDIO
:
if
(
audio_codec_name
)
codec
=
avcodec_find_decoder_by_name
(
audio_codec_name
);
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
if
(
subtitle_codec_name
)
codec
=
avcodec_find_decoder_by_name
(
subtitle_codec_name
);
break
;
...
...
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