aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-03-21 12:02:35 -0300
committerJames Almer <jamrial@gmail.com>2017-03-21 12:19:03 -0300
commitf7f5a524590bf3da35d3f84eefbf08cf7795468b (patch)
tree481d91e96b6d4d88f3642c96aedfc5210736f732
parent518158693ec3470b9600773f6f4b892fe7d59580 (diff)
downloadffmpeg-f7f5a524590bf3da35d3f84eefbf08cf7795468b.tar.gz
swresample/resample: move resample_free() higher in the file
Also make it more readable while at it. Signed-off-by: James Almer <jamrial@gmail.com> (cherry picked from commit 2a8a8a2e98136c22f6e07ff669251afb8a033676) Conflicts: libswresample/resample.c
-rw-r--r--libswresample/resample.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c
index 8f3eb41ad9..97bf9c46ed 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -171,6 +171,14 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
return 0;
}
+static void resample_free(ResampleContext **cc){
+ ResampleContext *c = *cc;
+ if(!c)
+ return;
+ av_freep(&c->filter_bank);
+ av_freep(cc);
+}
+
static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear,
double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, int kaiser_beta,
double precision, int cheby)
@@ -251,13 +259,6 @@ error:
return NULL;
}
-static void resample_free(ResampleContext **c){
- if(!*c)
- return;
- av_freep(&(*c)->filter_bank);
- av_freep(c);
-}
-
static int set_compensation(ResampleContext *c, int sample_delta, int compensation_distance){
c->compensation_distance= compensation_distance;
if (compensation_distance)