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
89de5157
Commit
89de5157
authored
Nov 23, 2013
by
Tim Walker
Committed by
Anton Khirnov
Nov 28, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dcadec: implement request_channel_layout.
Signed-off-by:
Anton Khirnov
<
anton@khirnov.net
>
parent
cf7860db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
5 deletions
+19
-5
dcadec.c
libavcodec/dcadec.c
+19
-5
No files found.
libavcodec/dcadec.c
View file @
89de5157
...
...
@@ -1288,7 +1288,8 @@ static int dca_filter_channels(DCAContext *s, int block_index)
}
/* Down mixing */
if
(
s
->
avctx
->
request_channels
==
2
&&
s
->
prim_channels
>
2
)
{
if
(
s
->
prim_channels
>
2
&&
s
->
avctx
->
request_channel_layout
==
AV_CH_LAYOUT_STEREO
)
{
dca_downmix
(
s
->
samples_chanptr
,
s
->
amode
,
s
->
downmix_coef
,
s
->
channel_order_tab
);
}
...
...
@@ -1803,8 +1804,14 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
if
(
s
->
amode
<
16
)
{
avctx
->
channel_layout
=
dca_core_channel_layout
[
s
->
amode
];
#if FF_API_REQUEST_CHANNELS
FF_DISABLE_DEPRECATION_WARNINGS
if
(
s
->
xch_present
&&
(
!
avctx
->
request_channels
||
avctx
->
request_channels
>
num_core_channels
+
!!
s
->
lfe
))
{
FF_ENABLE_DEPRECATION_WARNINGS
#else
if
(
s
->
xch_present
)
{
#endif
avctx
->
channel_layout
|=
AV_CH_BACK_CENTER
;
if
(
s
->
lfe
)
{
avctx
->
channel_layout
|=
AV_CH_LOW_FREQUENCY
;
...
...
@@ -1826,7 +1833,8 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
s
->
channel_order_tab
[
channels
-
1
-
!!
s
->
lfe
]
<
0
)
return
AVERROR_INVALIDDATA
;
if
(
avctx
->
request_channels
==
2
&&
s
->
prim_channels
>
2
)
{
if
(
s
->
prim_channels
>
2
&&
avctx
->
request_channel_layout
==
AV_CH_LAYOUT_STEREO
)
{
channels
=
2
;
s
->
output
=
DCA_STEREO
;
avctx
->
channel_layout
=
AV_CH_LAYOUT_STEREO
;
...
...
@@ -1922,9 +1930,15 @@ static av_cold int dca_decode_init(AVCodecContext *avctx)
avctx
->
sample_fmt
=
AV_SAMPLE_FMT_FLTP
;
/* allow downmixing to stereo */
if
(
avctx
->
channels
>
2
&&
avctx
->
request_channels
==
2
)
{
avctx
->
channels
=
avctx
->
request_channels
;
}
#if FF_API_REQUEST_CHANNELS
FF_DISABLE_DEPRECATION_WARNINGS
if
(
avctx
->
request_channels
==
2
)
avctx
->
request_channel_layout
=
AV_CH_LAYOUT_STEREO
;
FF_ENABLE_DEPRECATION_WARNINGS
#endif
if
(
avctx
->
channels
>
2
&&
avctx
->
request_channel_layout
==
AV_CH_LAYOUT_STEREO
)
avctx
->
channels
=
2
;
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