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
6d386619
Commit
6d386619
authored
Dec 30, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacdec: fix dual mono
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
518239cd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
19 deletions
+5
-19
aacdec.c
libavcodec/aacdec.c
+5
-19
No files found.
libavcodec/aacdec.c
View file @
6d386619
...
@@ -2435,7 +2435,6 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
...
@@ -2435,7 +2435,6 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
* WITHOUT specifying PCE.
* WITHOUT specifying PCE.
* thus, set dual mono as default.
* thus, set dual mono as default.
*/
*/
#if 0
if
(
ac
->
enable_jp_dmono
&&
ac
->
oc
[
0
].
status
==
OC_NONE
)
{
if
(
ac
->
enable_jp_dmono
&&
ac
->
oc
[
0
].
status
==
OC_NONE
)
{
layout_map_tags
=
2
;
layout_map_tags
=
2
;
layout_map
[
0
][
0
]
=
layout_map
[
1
][
0
]
=
TYPE_SCE
;
layout_map
[
0
][
0
]
=
layout_map
[
1
][
0
]
=
TYPE_SCE
;
...
@@ -2443,10 +2442,9 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
...
@@ -2443,10 +2442,9 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb)
layout_map
[
0
][
1
]
=
0
;
layout_map
[
0
][
1
]
=
0
;
layout_map
[
1
][
1
]
=
1
;
layout_map
[
1
][
1
]
=
1
;
if
(
output_configure
(
ac
,
layout_map
,
layout_map_tags
,
if
(
output_configure
(
ac
,
layout_map
,
layout_map_tags
,
OC_TRIAL_FRAME))
OC_TRIAL_FRAME
,
0
))
return
-
7
;
return
-
7
;
}
}
#endif
}
}
ac
->
oc
[
1
].
m4ac
.
sample_rate
=
hdr_info
.
sample_rate
;
ac
->
oc
[
1
].
m4ac
.
sample_rate
=
hdr_info
.
sample_rate
;
ac
->
oc
[
1
].
m4ac
.
sampling_index
=
hdr_info
.
sampling_index
;
ac
->
oc
[
1
].
m4ac
.
sampling_index
=
hdr_info
.
sampling_index
;
...
@@ -2472,7 +2470,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
...
@@ -2472,7 +2470,6 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
int
err
,
elem_id
;
int
err
,
elem_id
;
int
samples
=
0
,
multiplier
,
audio_found
=
0
,
pce_found
=
0
;
int
samples
=
0
,
multiplier
,
audio_found
=
0
,
pce_found
=
0
;
int
is_dmono
,
sce_count
=
0
;
int
is_dmono
,
sce_count
=
0
;
float
*
tmp
=
NULL
;
if
(
show_bits
(
gb
,
12
)
==
0xfff
)
{
if
(
show_bits
(
gb
,
12
)
==
0xfff
)
{
if
(
parse_adts_frame_header
(
ac
,
gb
)
<
0
)
{
if
(
parse_adts_frame_header
(
ac
,
gb
)
<
0
)
{
...
@@ -2590,34 +2587,23 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
...
@@ -2590,34 +2587,23 @@ static int aac_decode_frame_int(AVCodecContext *avctx, void *data,
multiplier
=
(
ac
->
oc
[
1
].
m4ac
.
sbr
==
1
)
?
ac
->
oc
[
1
].
m4ac
.
ext_sample_rate
>
ac
->
oc
[
1
].
m4ac
.
sample_rate
:
0
;
multiplier
=
(
ac
->
oc
[
1
].
m4ac
.
sbr
==
1
)
?
ac
->
oc
[
1
].
m4ac
.
ext_sample_rate
>
ac
->
oc
[
1
].
m4ac
.
sample_rate
:
0
;
samples
<<=
multiplier
;
samples
<<=
multiplier
;
#if 0
/* for dual-mono audio (SCE + SCE) */
/* for dual-mono audio (SCE + SCE) */
is_dmono
=
ac
->
enable_jp_dmono
&&
sce_count
==
2
&&
is_dmono
=
ac
->
enable_jp_dmono
&&
sce_count
==
2
&&
ac
->
oc
[
1
].
channel_layout
==
(
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
);
ac
->
oc
[
1
].
channel_layout
==
(
AV_CH_FRONT_LEFT
|
AV_CH_FRONT_RIGHT
);
if (is_dmono) {
if (ac->dmono_mode == 0) {
tmp = ac->output_data[1];
ac->output_data[1] = ac->output_data[0];
} else if (ac->dmono_mode == 1) {
tmp = ac->output_data[0];
ac->output_data[0] = ac->output_data[1];
}
}
#endif
if
(
samples
)
{
if
(
samples
)
{
ac
->
frame
.
nb_samples
=
samples
;
ac
->
frame
.
nb_samples
=
samples
;
*
(
AVFrame
*
)
data
=
ac
->
frame
;
*
(
AVFrame
*
)
data
=
ac
->
frame
;
}
}
*
got_frame_ptr
=
!!
samples
;
*
got_frame_ptr
=
!!
samples
;
#if 0
if
(
is_dmono
)
{
if
(
is_dmono
)
{
if
(
ac
->
dmono_mode
==
0
)
if
(
ac
->
dmono_mode
==
0
)
ac->output_data[1] = tmp
;
((
AVFrame
*
)
data
)
->
data
[
1
]
=
((
AVFrame
*
)
data
)
->
data
[
0
]
;
else
if
(
ac
->
dmono_mode
==
1
)
else
if
(
ac
->
dmono_mode
==
1
)
ac->output_data[0] = tmp
;
((
AVFrame
*
)
data
)
->
data
[
0
]
=
((
AVFrame
*
)
data
)
->
data
[
1
]
;
}
}
#endif
if
(
ac
->
oc
[
1
].
status
&&
audio_found
)
{
if
(
ac
->
oc
[
1
].
status
&&
audio_found
)
{
avctx
->
sample_rate
=
ac
->
oc
[
1
].
m4ac
.
sample_rate
<<
multiplier
;
avctx
->
sample_rate
=
ac
->
oc
[
1
].
m4ac
.
sample_rate
<<
multiplier
;
avctx
->
frame_size
=
samples
;
avctx
->
frame_size
=
samples
;
...
...
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