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
87c739a3
Commit
87c739a3
authored
Jun 15, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: don't abuse a global for passing channel layout from input to output
It's broken with multiple files or audio streams.
parent
1cede1d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
3 deletions
+1
-3
ffmpeg.c
ffmpeg.c
+1
-3
No files found.
ffmpeg.c
View file @
87c739a3
...
@@ -161,7 +161,6 @@ static char *vfilters = NULL;
...
@@ -161,7 +161,6 @@ static char *vfilters = NULL;
static
int
intra_only
=
0
;
static
int
intra_only
=
0
;
static
int
audio_sample_rate
=
0
;
static
int
audio_sample_rate
=
0
;
static
int64_t
channel_layout
=
0
;
#define QSCALE_NONE -99999
#define QSCALE_NONE -99999
static
float
audio_qscale
=
QSCALE_NONE
;
static
float
audio_qscale
=
QSCALE_NONE
;
static
int
audio_disable
=
0
;
static
int
audio_disable
=
0
;
...
@@ -2183,6 +2182,7 @@ static int transcode(AVFormatContext **output_files,
...
@@ -2183,6 +2182,7 @@ static int transcode(AVFormatContext **output_files,
codec
->
time_base
=
(
AVRational
){
1
,
codec
->
sample_rate
};
codec
->
time_base
=
(
AVRational
){
1
,
codec
->
sample_rate
};
if
(
!
codec
->
channels
)
if
(
!
codec
->
channels
)
codec
->
channels
=
icodec
->
channels
;
codec
->
channels
=
icodec
->
channels
;
codec
->
channel_layout
=
icodec
->
channel_layout
;
if
(
av_get_channel_layout_nb_channels
(
codec
->
channel_layout
)
!=
codec
->
channels
)
if
(
av_get_channel_layout_nb_channels
(
codec
->
channel_layout
)
!=
codec
->
channels
)
codec
->
channel_layout
=
0
;
codec
->
channel_layout
=
0
;
ost
->
audio_resample
=
codec
->
sample_rate
!=
icodec
->
sample_rate
||
audio_sync_method
>
1
;
ost
->
audio_resample
=
codec
->
sample_rate
!=
icodec
->
sample_rate
||
audio_sync_method
>
1
;
...
@@ -3306,7 +3306,6 @@ static int opt_input_file(const char *opt, const char *filename)
...
@@ -3306,7 +3306,6 @@ static int opt_input_file(const char *opt, const char *filename)
case
AVMEDIA_TYPE_AUDIO
:
case
AVMEDIA_TYPE_AUDIO
:
ist
->
dec
=
avcodec_find_decoder_by_name
(
audio_codec_name
);
ist
->
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
,
ist
->
dec
);
set_context_opts
(
dec
,
avcodec_opts
[
AVMEDIA_TYPE_AUDIO
],
AV_OPT_FLAG_AUDIO_PARAM
|
AV_OPT_FLAG_DECODING_PARAM
,
ist
->
dec
);
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
;
...
@@ -3605,7 +3604,6 @@ static void new_audio_stream(AVFormatContext *oc, int file_idx)
...
@@ -3605,7 +3604,6 @@ static void new_audio_stream(AVFormatContext *oc, int file_idx)
audio_enc
->
sample_fmt
=
audio_sample_fmt
;
audio_enc
->
sample_fmt
=
audio_sample_fmt
;
if
(
audio_sample_rate
)
if
(
audio_sample_rate
)
audio_enc
->
sample_rate
=
audio_sample_rate
;
audio_enc
->
sample_rate
=
audio_sample_rate
;
audio_enc
->
channel_layout
=
channel_layout
;
choose_sample_fmt
(
st
,
codec
);
choose_sample_fmt
(
st
,
codec
);
}
}
if
(
audio_language
)
{
if
(
audio_language
)
{
...
...
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