[FFmpeg-cvslog] swresample/resample: move resample_free() higher in the file
James Almer
git at videolan.org
Tue Mar 21 17:23:19 EET 2017
ffmpeg | branch: release/3.1 | James Almer <jamrial at gmail.com> | Tue Mar 21 12:02:35 2017 -0300| [f9083dec0c2ef79ab44d7511f86bd0bf7fe45978] | committer: James Almer
swresample/resample: move resample_free() higher in the file
Also make it more readable while at it.
Signed-off-by: James Almer <jamrial at gmail.com>
(cherry picked from commit 2a8a8a2e98136c22f6e07ff669251afb8a033676)
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f9083dec0c2ef79ab44d7511f86bd0bf7fe45978
---
libswresample/resample.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/libswresample/resample.c b/libswresample/resample.c
index b834248..2e161b1 100644
--- a/libswresample/resample.c
+++ b/libswresample/resample.c
@@ -298,6 +298,14 @@ fail:
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, double kaiser_beta,
double precision, int cheby, int exact_rational)
@@ -389,13 +397,6 @@ error:
return NULL;
}
-static void resample_free(ResampleContext **c){
- if(!*c)
- return;
- av_freep(&(*c)->filter_bank);
- av_freep(c);
-}
-
static int rebuild_filter_bank_with_compensation(ResampleContext *c)
{
uint8_t *new_filter_bank;
More information about the ffmpeg-cvslog
mailing list