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
62600469
Commit
62600469
authored
Dec 19, 2007
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow overriding codec_ids.
Originally committed as revision 11266 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
379374ea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
1 deletion
+39
-1
ffmpeg.c
ffmpeg.c
+5
-0
avformat.h
libavformat/avformat.h
+16
-0
utils.c
libavformat/utils.c
+18
-1
No files found.
ffmpeg.c
View file @
62600469
...
...
@@ -2662,6 +2662,11 @@ static void opt_input_file(const char *filename)
if
(
str
&&
(
opt
->
flags
&
AV_OPT_FLAG_DECODING_PARAM
))
av_set_string
(
ic
,
opt_names
[
i
],
str
);
}
ic
->
video_codec_id
=
find_codec_or_die
(
video_codec_name
,
CODEC_TYPE_VIDEO
,
0
);
ic
->
audio_codec_id
=
find_codec_or_die
(
audio_codec_name
,
CODEC_TYPE_AUDIO
,
0
);
ic
->
subtitle_codec_id
=
find_codec_or_die
(
subtitle_codec_name
,
CODEC_TYPE_SUBTITLE
,
0
);
/* open the input file with generic libav function */
err
=
av_open_input_file
(
&
ic
,
filename
,
file_iformat
,
0
,
ap
);
if
(
err
<
0
)
{
...
...
libavformat/avformat.h
View file @
62600469
...
...
@@ -445,6 +445,22 @@ typedef struct AVFormatContext {
unsigned
int
nb_programs
;
AVProgram
**
programs
;
/**
* Forced video codec_id.
* demuxing: set by user
*/
enum
CodecID
video_codec_id
;
/**
* Forced audio codec_id.
* demuxing: set by user
*/
enum
CodecID
audio_codec_id
;
/**
* Forced subtitle codec_id.
* demuxing: set by user
*/
enum
CodecID
subtitle_codec_id
;
}
AVFormatContext
;
typedef
struct
AVPacketList
{
...
...
libavformat/utils.c
View file @
62600469
...
...
@@ -493,8 +493,25 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
int
av_read_packet
(
AVFormatContext
*
s
,
AVPacket
*
pkt
)
{
int
ret
;
AVStream
*
st
;
av_init_packet
(
pkt
);
return
s
->
iformat
->
read_packet
(
s
,
pkt
);
ret
=
s
->
iformat
->
read_packet
(
s
,
pkt
);
st
=
s
->
streams
[
pkt
->
stream_index
];
switch
(
st
->
codec
->
codec_type
){
case
CODEC_TYPE_VIDEO
:
if
(
s
->
video_codec_id
)
st
->
codec
->
codec_id
=
s
->
video_codec_id
;
break
;
case
CODEC_TYPE_AUDIO
:
if
(
s
->
audio_codec_id
)
st
->
codec
->
codec_id
=
s
->
audio_codec_id
;
break
;
case
CODEC_TYPE_SUBTITLE
:
if
(
s
->
subtitle_codec_id
)
st
->
codec
->
codec_id
=
s
->
subtitle_codec_id
;
break
;
}
return
ret
;
}
/**********************************************************/
...
...
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