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
788d7a8c
Commit
788d7a8c
authored
Nov 12, 2004
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
av_resample_compensate() doxy
Originally committed as revision 3671 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
61c52ead
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
resample2.c
libavcodec/resample2.c
+12
-0
No files found.
libavcodec/resample2.c
View file @
788d7a8c
...
@@ -159,6 +159,18 @@ void av_resample_close(AVResampleContext *c){
...
@@ -159,6 +159,18 @@ void av_resample_close(AVResampleContext *c){
av_freep
(
&
c
);
av_freep
(
&
c
);
}
}
/**
* Compensates samplerate/timestamp drift. The compensation is done by changing
* the resampler parameters, so no audible clicks or similar distortions ocur
* @param compensation_distance distance in output samples over which the compensation should be performed
* @param sample_delta number of output samples which should be output less
*
* example: av_resample_compensate(c, 10, 500)
* here instead of 510 samples only 500 samples would be output
*
* note, due to rounding the actual compensation might be slightly different,
* especially if the compensation_distance is large and the in_rate used during init is small
*/
void
av_resample_compensate
(
AVResampleContext
*
c
,
int
sample_delta
,
int
compensation_distance
){
void
av_resample_compensate
(
AVResampleContext
*
c
,
int
sample_delta
,
int
compensation_distance
){
// sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr;
// sample_delta += (c->ideal_dst_incr - c->dst_incr)*(int64_t)c->compensation_distance / c->ideal_dst_incr;
c
->
compensation_distance
=
compensation_distance
;
c
->
compensation_distance
=
compensation_distance
;
...
...
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