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
11b2eed4
Commit
11b2eed4
authored
9 years ago
by
Vittorio Giovara
Browse files
Options
Downloads
Patches
Plain Diff
lavr: Drop deprecated context reinitialization if resampling was not enabled
Deprecated in 11/2012.
parent
9d58639e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libavresample/resample.c
+0
-54
0 additions, 54 deletions
libavresample/resample.c
libavresample/version.h
+0
-4
0 additions, 4 deletions
libavresample/version.h
with
0 additions
and
58 deletions
libavresample/resample.c
+
0
−
54
View file @
11b2eed4
...
@@ -243,62 +243,8 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
...
@@ -243,62 +243,8 @@ int avresample_set_compensation(AVAudioResampleContext *avr, int sample_delta,
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
if
(
!
avr
->
resample_needed
)
{
if
(
!
avr
->
resample_needed
)
{
#if FF_API_RESAMPLE_CLOSE_OPEN
/* if resampling was not enabled previously, re-initialize the
AVAudioResampleContext and force resampling */
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 */
fifo_samples
=
av_audio_fifo_size
(
avr
->
out_fifo
);
if
(
fifo_samples
>
0
)
{
fifo_buf
=
ff_audio_data_alloc
(
avr
->
out_channels
,
fifo_samples
,
avr
->
out_sample_fmt
,
NULL
);
if
(
!
fifo_buf
)
return
AVERROR
(
EINVAL
);
ret
=
ff_audio_data_read_from_fifo
(
avr
->
out_fifo
,
fifo_buf
,
fifo_samples
);
if
(
ret
<
0
)
goto
reinit_fail
;
}
/* save the channel mixing matrix */
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
);
avr
->
force_resampling
=
1
;
/* restore the channel mixing matrix */
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
);
if
(
ret
<
0
)
goto
reinit_fail
;
/* restore buffered samples to the output FIFO */
if
(
fifo_samples
>
0
)
{
ret
=
ff_audio_data_add_to_fifo
(
avr
->
out_fifo
,
fifo_buf
,
0
,
fifo_samples
);
if
(
ret
<
0
)
goto
reinit_fail
;
ff_audio_data_free
(
&
fifo_buf
);
}
#else
av_log
(
avr
,
AV_LOG_ERROR
,
"Unable to set resampling compensation
\n
"
);
av_log
(
avr
,
AV_LOG_ERROR
,
"Unable to set resampling compensation
\n
"
);
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
#endif
}
}
c
=
avr
->
resample
;
c
=
avr
->
resample
;
c
->
compensation_distance
=
compensation_distance
;
c
->
compensation_distance
=
compensation_distance
;
...
...
This diff is collapsed.
Click to expand it.
libavresample/version.h
+
0
−
4
View file @
11b2eed4
...
@@ -47,8 +47,4 @@
...
@@ -47,8 +47,4 @@
* the public API and may change, break or disappear at any time.
* the public API and may change, break or disappear at any time.
*/
*/
#ifndef FF_API_RESAMPLE_CLOSE_OPEN
#define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 3)
#endif
#endif
/* AVRESAMPLE_VERSION_H */
#endif
/* AVRESAMPLE_VERSION_H */
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