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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
libremedia
Tethys
FFmpeg
Commits
f322b207
Commit
f322b207
authored
12 years ago
by
Justin Ruggles
Browse files
Options
Downloads
Patches
Plain Diff
lavr: only save/restore the mixing matrix if mixing is being done
parent
e798085f
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/resample.c
+12
-6
12 additions, 6 deletions
libavresample/resample.c
with
12 additions
and
6 deletions
libavresample/resample.c
+
12
−
6
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
);
...
...
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