Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
7b050258
Commit
7b050258
authored
Feb 08, 2012
by
Alex Converse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
aacdec: Unify preconfigured layout and PCE layout.
parent
f1ecd080
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
41 deletions
+16
-41
aacdec.c
libavcodec/aacdec.c
+16
-41
No files found.
libavcodec/aacdec.c
View file @
7b050258
...
...
@@ -409,56 +409,31 @@ static av_cold int output_configure(AACContext *ac,
{
AVCodecContext
*
avctx
=
ac
->
avctx
;
int
i
,
channels
=
0
,
ret
;
uint64_t
layout
=
0
;
if
(
ac
->
layout_map
!=
layout_map
)
{
memcpy
(
ac
->
layout_map
,
layout_map
,
tags
*
sizeof
(
layout_map
[
0
]));
ac
->
layout_map_tags
=
tags
;
}
if
(
channel_config
)
{
if
(
avctx
->
request_channel_layout
!=
AV_CH_LAYOUT_NATIVE
)
sniff_channel_order
(
layout_map
,
tags
);
for
(
i
=
0
;
i
<
tags_per_config
[
channel_config
];
i
++
)
{
int
type
=
layout_map
[
i
][
0
];
int
id
=
layout_map
[
i
][
1
];
int
position
=
layout_map
[
i
][
2
];
if
((
ret
=
che_configure
(
ac
,
position
,
type
,
id
,
&
channels
)))
return
ret
;
}
memset
(
ac
->
tag_che_map
,
0
,
4
*
MAX_ELEM_ID
*
sizeof
(
ac
->
che
[
0
][
0
]));
avctx
->
channel_layout
=
aac_channel_layout
[
channel_config
-
1
];
}
else
{
/* Allocate or free elements depending on if they are in the
* current program configuration.
*
* Try to sniff a reasonable channel order, otherwise output the
* channels in the order the PCE declared them.
*/
uint64_t
layout
=
0
;
if
(
avctx
->
request_channel_layout
!=
AV_CH_LAYOUT_NATIVE
)
layout
=
sniff_channel_order
(
layout_map
,
tags
);
for
(
i
=
0
;
i
<
tags
;
i
++
)
{
int
type
=
layout_map
[
i
][
0
];
int
id
=
layout_map
[
i
][
1
];
int
position
=
layout_map
[
i
][
2
];
if
((
ret
=
che_configure
(
ac
,
position
,
type
,
id
,
&
channels
)))
return
ret
;
}
memcpy
(
ac
->
tag_che_map
,
ac
->
che
,
4
*
MAX_ELEM_ID
*
sizeof
(
ac
->
che
[
0
][
0
]));
avctx
->
channel_layout
=
layout
;
// Try to sniff a reasonable channel order, otherwise output the
// channels in the order the PCE declared them.
if
(
avctx
->
request_channel_layout
!=
AV_CH_LAYOUT_NATIVE
)
layout
=
sniff_channel_order
(
layout_map
,
tags
);
for
(
i
=
0
;
i
<
tags
;
i
++
)
{
int
type
=
layout_map
[
i
][
0
];
int
id
=
layout_map
[
i
][
1
];
int
position
=
layout_map
[
i
][
2
];
// Allocate or free elements depending on if they are in the
// current program configuration.
ret
=
che_configure
(
ac
,
position
,
type
,
id
,
&
channels
);
if
(
ret
<
0
)
return
ret
;
}
memcpy
(
ac
->
tag_che_map
,
ac
->
che
,
4
*
MAX_ELEM_ID
*
sizeof
(
ac
->
che
[
0
][
0
]));
avctx
->
channel_layout
=
layout
;
avctx
->
channels
=
channels
;
ac
->
output_configured
=
oc_type
;
return
0
;
...
...
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