Commit 2423dd96 authored by James Almer's avatar James Almer

swresample/resample: move resample_free() higher in the file

Also make it more readable while at it.
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
(cherry picked from commit 2a8a8a2e)

Conflicts:
	libswresample/resample.c
parent dffd455b
...@@ -295,6 +295,14 @@ fail: ...@@ -295,6 +295,14 @@ fail:
return 0; 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, 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, double kaiser_beta, double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, double kaiser_beta,
double precision, int cheby) double precision, int cheby)
...@@ -375,13 +383,6 @@ error: ...@@ -375,13 +383,6 @@ error:
return NULL; 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){ static int set_compensation(ResampleContext *c, int sample_delta, int compensation_distance){
c->compensation_distance= compensation_distance; c->compensation_distance= compensation_distance;
if (compensation_distance) if (compensation_distance)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment