Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
ffmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Samuel Mira
ffmpeg
Commits
646831e6
Commit
646831e6
authored
12 years ago
by
Justin Ruggles
Browse files
Options
Downloads
Patches
Plain Diff
lavr: print out the mix matrix in ff_audio_mix_set_matrix()
This will print the new matrix if it is set after initialization.
parent
8ae50d87
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavresample/audio_mix.c
+29
-26
29 additions, 26 deletions
libavresample/audio_mix.c
with
29 additions
and
26 deletions
libavresample/audio_mix.c
+
29
−
26
View file @
646831e6
...
...
@@ -370,9 +370,6 @@ AudioMix *ff_audio_mix_alloc(AVAudioResampleContext *avr)
goto
error
;
av_freep
(
&
avr
->
mix_matrix
);
}
else
{
int
i
,
j
;
char
in_layout_name
[
128
];
char
out_layout_name
[
128
];
double
*
matrix_dbl
=
av_mallocz
(
avr
->
out_channels
*
avr
->
in_channels
*
sizeof
(
*
matrix_dbl
));
if
(
!
matrix_dbl
)
...
...
@@ -399,27 +396,6 @@ AudioMix *ff_audio_mix_alloc(AVAudioResampleContext *avr)
goto
error
;
}
av_get_channel_layout_string
(
in_layout_name
,
sizeof
(
in_layout_name
),
avr
->
in_channels
,
avr
->
in_channel_layout
);
av_get_channel_layout_string
(
out_layout_name
,
sizeof
(
out_layout_name
),
avr
->
out_channels
,
avr
->
out_channel_layout
);
av_log
(
avr
,
AV_LOG_DEBUG
,
"audio_mix: %s to %s
\n
"
,
in_layout_name
,
out_layout_name
);
av_log
(
avr
,
AV_LOG_DEBUG
,
"matrix size: %d x %d
\n
"
,
am
->
in_matrix_channels
,
am
->
out_matrix_channels
);
for
(
i
=
0
;
i
<
avr
->
out_channels
;
i
++
)
{
for
(
j
=
0
;
j
<
avr
->
in_channels
;
j
++
)
{
if
(
am
->
output_zero
[
i
])
av_log
(
avr
,
AV_LOG_DEBUG
,
" (ZERO)"
);
else
if
(
am
->
input_skip
[
j
]
||
am
->
output_skip
[
i
])
av_log
(
avr
,
AV_LOG_DEBUG
,
" (SKIP)"
);
else
av_log
(
avr
,
AV_LOG_DEBUG
,
" %0.3f "
,
matrix_dbl
[
i
*
avr
->
in_channels
+
j
]);
}
av_log
(
avr
,
AV_LOG_DEBUG
,
"
\n
"
);
}
av_free
(
matrix_dbl
);
}
...
...
@@ -553,7 +529,9 @@ int ff_audio_mix_get_matrix(AudioMix *am, double *matrix, int stride)
int
ff_audio_mix_set_matrix
(
AudioMix
*
am
,
const
double
*
matrix
,
int
stride
)
{
int
i
,
o
,
i0
,
o0
;
int
i
,
o
,
i0
,
o0
,
ret
;
char
in_layout_name
[
128
];
char
out_layout_name
[
128
];
if
(
am
->
in_channels
<=
0
||
am
->
in_channels
>
AVRESAMPLE_MAX_CHANNELS
||
am
->
out_channels
<=
0
||
am
->
out_channels
>
AVRESAMPLE_MAX_CHANNELS
)
{
...
...
@@ -701,5 +679,30 @@ int ff_audio_mix_set_matrix(AudioMix *am, const double *matrix, int stride)
return
AVERROR
(
EINVAL
);
}
return
mix_function_init
(
am
);
ret
=
mix_function_init
(
am
);
if
(
ret
<
0
)
return
ret
;
av_get_channel_layout_string
(
in_layout_name
,
sizeof
(
in_layout_name
),
am
->
in_channels
,
am
->
in_layout
);
av_get_channel_layout_string
(
out_layout_name
,
sizeof
(
out_layout_name
),
am
->
out_channels
,
am
->
out_layout
);
av_log
(
am
->
avr
,
AV_LOG_DEBUG
,
"audio_mix: %s to %s
\n
"
,
in_layout_name
,
out_layout_name
);
av_log
(
am
->
avr
,
AV_LOG_DEBUG
,
"matrix size: %d x %d
\n
"
,
am
->
in_matrix_channels
,
am
->
out_matrix_channels
);
for
(
o
=
0
;
o
<
am
->
out_channels
;
o
++
)
{
for
(
i
=
0
;
i
<
am
->
in_channels
;
i
++
)
{
if
(
am
->
output_zero
[
o
])
av_log
(
am
->
avr
,
AV_LOG_DEBUG
,
" (ZERO)"
);
else
if
(
am
->
input_skip
[
i
]
||
am
->
output_skip
[
o
])
av_log
(
am
->
avr
,
AV_LOG_DEBUG
,
" (SKIP)"
);
else
av_log
(
am
->
avr
,
AV_LOG_DEBUG
,
" %0.3f "
,
matrix
[
o
*
am
->
in_channels
+
i
]);
}
av_log
(
am
->
avr
,
AV_LOG_DEBUG
,
"
\n
"
);
}
return
0
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment