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
f322b207
Commit
f322b207
authored
Nov 30, 2012
by
Justin Ruggles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavr: only save/restore the mixing matrix if mixing is being done
parent
e798085f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
resample.c
libavresample/resample.c
+12
-6
No files found.
libavresample/resample.c
View file @
f322b207
...
...
@@ -259,6 +259,7 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
AVAudioResampleContext and force resampling */
if
(
!
avr
->
resample_needed
)
{
int
fifo_samples
;
int
restore_matrix
=
0
;
double
matrix
[
AVRESAMPLE_MAX_CHANNELS
*
AVRESAMPLE_MAX_CHANNELS
]
=
{
0
};
/* buffer any remaining samples in the output FIFO before closing */
...
...
@@ -274,9 +275,12 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
goto
reinit_fail
;
}
/* save the channel mixing matrix */
ret
=
avresample_get_matrix
(
avr
,
matrix
,
AVRESAMPLE_MAX_CHANNELS
);
if
(
ret
<
0
)
goto
reinit_fail
;
if
(
avr
->
am
)
{
ret
=
avresample_get_matrix
(
avr
,
matrix
,
AVRESAMPLE_MAX_CHANNELS
);
if
(
ret
<
0
)
goto
reinit_fail
;
restore_matrix
=
1
;
}
/* close the AVAudioResampleContext */
avresample_close
(
avr
);
...
...
@@ -284,9 +288,11 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
avr
->
force_resampling
=
1
;
/* restore the channel mixing matrix */
ret
=
avresample_set_matrix
(
avr
,
matrix
,
AVRESAMPLE_MAX_CHANNELS
);
if
(
ret
<
0
)
goto
reinit_fail
;
if
(
restore_matrix
)
{
ret
=
avresample_set_matrix
(
avr
,
matrix
,
AVRESAMPLE_MAX_CHANNELS
);
if
(
ret
<
0
)
goto
reinit_fail
;
}
/* re-open the AVAudioResampleContext */
ret
=
avresample_open
(
avr
);
...
...
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