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
9e253c13
Commit
9e253c13
authored
Jun 23, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: merge input_codecs into input_streams.
There's no point in keeping them separate.
parent
17c8cc55
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
ffmpeg.c
ffmpeg.c
+7
-10
No files found.
ffmpeg.c
View file @
9e253c13
...
@@ -109,8 +109,6 @@ static const OptionDef options[];
...
@@ -109,8 +109,6 @@ static const OptionDef options[];
static
const
char
*
last_asked_format
=
NULL
;
static
const
char
*
last_asked_format
=
NULL
;
static
int64_t
input_files_ts_offset
[
MAX_FILES
];
static
int64_t
input_files_ts_offset
[
MAX_FILES
];
static
double
*
input_files_ts_scale
[
MAX_FILES
]
=
{
NULL
};
static
double
*
input_files_ts_scale
[
MAX_FILES
]
=
{
NULL
};
static
AVCodec
**
input_codecs
=
NULL
;
static
int
nb_input_codecs
=
0
;
static
int
nb_input_files_ts_scale
[
MAX_FILES
]
=
{
0
};
static
int
nb_input_files_ts_scale
[
MAX_FILES
]
=
{
0
};
static
AVFormatContext
*
output_files
[
MAX_FILES
];
static
AVFormatContext
*
output_files
[
MAX_FILES
];
...
@@ -310,6 +308,7 @@ typedef struct InputStream {
...
@@ -310,6 +308,7 @@ typedef struct InputStream {
int
discard
;
/* true if stream data should be discarded */
int
discard
;
/* true if stream data should be discarded */
int
decoding_needed
;
/* true if the packets must be decoded in 'raw_fifo' */
int
decoding_needed
;
/* true if the packets must be decoded in 'raw_fifo' */
int64_t
sample_index
;
/* current sample */
int64_t
sample_index
;
/* current sample */
AVCodec
*
dec
;
int64_t
start
;
/* time when read started */
int64_t
start
;
/* time when read started */
int64_t
next_pts
;
/* synthetic pts for cases where pkt.pts
int64_t
next_pts
;
/* synthetic pts for cases where pkt.pts
...
@@ -479,7 +478,6 @@ static int ffmpeg_exit(int ret)
...
@@ -479,7 +478,6 @@ static int ffmpeg_exit(int ret)
av_free
(
vstats_filename
);
av_free
(
vstats_filename
);
av_free
(
streamid_map
);
av_free
(
streamid_map
);
av_free
(
input_codecs
);
av_free
(
stream_maps
);
av_free
(
stream_maps
);
av_free
(
meta_data_maps
);
av_free
(
meta_data_maps
);
...
@@ -2345,7 +2343,7 @@ static int transcode(AVFormatContext **output_files,
...
@@ -2345,7 +2343,7 @@ static int transcode(AVFormatContext **output_files,
for
(
i
=
0
;
i
<
nb_input_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
nb_input_streams
;
i
++
)
{
ist
=
&
input_streams
[
i
];
ist
=
&
input_streams
[
i
];
if
(
ist
->
decoding_needed
)
{
if
(
ist
->
decoding_needed
)
{
AVCodec
*
codec
=
i
<
nb_input_codecs
?
input_codecs
[
i
]
:
NULL
;
AVCodec
*
codec
=
i
st
->
dec
;
if
(
!
codec
)
if
(
!
codec
)
codec
=
avcodec_find_decoder
(
ist
->
st
->
codec
->
codec_id
);
codec
=
avcodec_find_decoder
(
ist
->
st
->
codec
->
codec_id
);
if
(
!
codec
)
{
if
(
!
codec
)
{
...
@@ -3301,7 +3299,6 @@ static int opt_input_file(const char *opt, const char *filename)
...
@@ -3301,7 +3299,6 @@ static int opt_input_file(const char *opt, const char *filename)
InputStream
*
ist
;
InputStream
*
ist
;
dec
->
thread_count
=
thread_count
;
dec
->
thread_count
=
thread_count
;
input_codecs
=
grow_array
(
input_codecs
,
sizeof
(
*
input_codecs
),
&
nb_input_codecs
,
nb_input_codecs
+
1
);
input_streams
=
grow_array
(
input_streams
,
sizeof
(
*
input_streams
),
&
nb_input_streams
,
nb_input_streams
+
1
);
input_streams
=
grow_array
(
input_streams
,
sizeof
(
*
input_streams
),
&
nb_input_streams
,
nb_input_streams
+
1
);
ist
=
&
input_streams
[
nb_input_streams
-
1
];
ist
=
&
input_streams
[
nb_input_streams
-
1
];
...
@@ -3311,16 +3308,16 @@ static int opt_input_file(const char *opt, const char *filename)
...
@@ -3311,16 +3308,16 @@ static int opt_input_file(const char *opt, const char *filename)
switch
(
dec
->
codec_type
)
{
switch
(
dec
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
case
AVMEDIA_TYPE_AUDIO
:
i
nput_codecs
[
nb_input_codecs
-
1
]
=
avcodec_find_decoder_by_name
(
audio_codec_name
);
i
st
->
dec
=
avcodec_find_decoder_by_name
(
audio_codec_name
);
set_context_opts
(
dec
,
avcodec_opts
[
AVMEDIA_TYPE_AUDIO
],
AV_OPT_FLAG_AUDIO_PARAM
|
AV_OPT_FLAG_DECODING_PARAM
,
i
nput_codecs
[
nb_input_codecs
-
1
]
);
set_context_opts
(
dec
,
avcodec_opts
[
AVMEDIA_TYPE_AUDIO
],
AV_OPT_FLAG_AUDIO_PARAM
|
AV_OPT_FLAG_DECODING_PARAM
,
i
st
->
dec
);
channel_layout
=
dec
->
channel_layout
;
channel_layout
=
dec
->
channel_layout
;
audio_sample_fmt
=
dec
->
sample_fmt
;
audio_sample_fmt
=
dec
->
sample_fmt
;
if
(
audio_disable
)
if
(
audio_disable
)
st
->
discard
=
AVDISCARD_ALL
;
st
->
discard
=
AVDISCARD_ALL
;
break
;
break
;
case
AVMEDIA_TYPE_VIDEO
:
case
AVMEDIA_TYPE_VIDEO
:
i
nput_codecs
[
nb_input_codecs
-
1
]
=
avcodec_find_decoder_by_name
(
video_codec_name
);
i
st
->
dec
=
avcodec_find_decoder_by_name
(
video_codec_name
);
set_context_opts
(
dec
,
avcodec_opts
[
AVMEDIA_TYPE_VIDEO
],
AV_OPT_FLAG_VIDEO_PARAM
|
AV_OPT_FLAG_DECODING_PARAM
,
i
nput_codecs
[
nb_input_codecs
-
1
]
);
set_context_opts
(
dec
,
avcodec_opts
[
AVMEDIA_TYPE_VIDEO
],
AV_OPT_FLAG_VIDEO_PARAM
|
AV_OPT_FLAG_DECODING_PARAM
,
i
st
->
dec
);
rfps
=
ic
->
streams
[
i
]
->
r_frame_rate
.
num
;
rfps
=
ic
->
streams
[
i
]
->
r_frame_rate
.
num
;
rfps_base
=
ic
->
streams
[
i
]
->
r_frame_rate
.
den
;
rfps_base
=
ic
->
streams
[
i
]
->
r_frame_rate
.
den
;
if
(
dec
->
lowres
)
{
if
(
dec
->
lowres
)
{
...
@@ -3348,7 +3345,7 @@ static int opt_input_file(const char *opt, const char *filename)
...
@@ -3348,7 +3345,7 @@ static int opt_input_file(const char *opt, const char *filename)
case
AVMEDIA_TYPE_DATA
:
case
AVMEDIA_TYPE_DATA
:
break
;
break
;
case
AVMEDIA_TYPE_SUBTITLE
:
case
AVMEDIA_TYPE_SUBTITLE
:
i
nput_codecs
[
nb_input_codecs
-
1
]
=
avcodec_find_decoder_by_name
(
subtitle_codec_name
);
i
st
->
dec
=
avcodec_find_decoder_by_name
(
subtitle_codec_name
);
if
(
subtitle_disable
)
if
(
subtitle_disable
)
st
->
discard
=
AVDISCARD_ALL
;
st
->
discard
=
AVDISCARD_ALL
;
break
;
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