Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
4acd43a2
Commit
4acd43a2
authored
Jan 07, 2012
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacdec: Turn off PS for multichannel files that use PCE based configs.
Fixes al_sbr_cm_48_5.1.mp4.
parent
1ef8ff45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
2 deletions
+20
-2
aac.h
libavcodec/aac.h
+1
-0
aacdec.c
libavcodec/aacdec.c
+19
-2
No files found.
libavcodec/aac.h
View file @
4acd43a2
...
...
@@ -84,6 +84,7 @@ enum BandType {
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
enum
ChannelPosition
{
AAC_CHANNEL_OFF
=
0
,
AAC_CHANNEL_FRONT
=
1
,
AAC_CHANNEL_SIDE
=
2
,
AAC_CHANNEL_BACK
=
3
,
...
...
libavcodec/aacdec.c
View file @
4acd43a2
...
...
@@ -163,6 +163,19 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
}
}
static
int
count_channels
(
enum
ChannelPosition
che_pos
[
4
][
MAX_ELEM_ID
])
{
int
i
,
type
,
sum
=
0
;
for
(
i
=
0
;
i
<
MAX_ELEM_ID
;
i
++
)
{
for
(
type
=
0
;
type
<
4
;
type
++
)
{
sum
+=
(
1
+
(
type
==
TYPE_CPE
))
*
(
che_pos
[
type
][
i
]
!=
AAC_CHANNEL_OFF
&&
che_pos
[
type
][
i
]
!=
AAC_CHANNEL_CC
);
}
}
return
sum
;
}
/**
* Check for the channel element in the current channel position configuration.
* If it exists, make sure the appropriate element is allocated and map the
...
...
@@ -418,6 +431,12 @@ static int decode_ga_specific_config(AACContext *ac, AVCodecContext *avctx,
if
((
ret
=
set_default_channel_config
(
avctx
,
new_che_pos
,
channel_config
)))
return
ret
;
}
if
(
count_channels
(
new_che_pos
)
>
1
)
{
m4ac
->
ps
=
0
;
}
else
if
(
m4ac
->
sbr
==
1
&&
m4ac
->
ps
==
-
1
)
m4ac
->
ps
=
1
;
if
(
ac
&&
(
ret
=
output_configure
(
ac
,
ac
->
che_pos
,
new_che_pos
,
channel_config
,
OC_GLOBAL_HDR
)))
return
ret
;
...
...
@@ -476,8 +495,6 @@ static int decode_audio_specific_config(AACContext *ac,
av_log
(
avctx
,
AV_LOG_ERROR
,
"invalid sampling rate index %d
\n
"
,
m4ac
->
sampling_index
);
return
-
1
;
}
if
(
m4ac
->
sbr
==
1
&&
m4ac
->
ps
==
-
1
)
m4ac
->
ps
=
1
;
skip_bits_long
(
&
gb
,
i
);
...
...
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