diff options
author | James Almer <jamrial@gmail.com> | 2017-03-21 12:02:35 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2017-03-21 12:11:57 -0300 |
commit | 2d322bf3e9d9c7713bd888517d7348faf1c31622 (patch) | |
tree | 001871eb09343c9d95c81e39a7260d69dde30905 | |
parent | 36fff6c75459a7e23ad04be60264643e9c3d2ce8 (diff) | |
download | ffmpeg-2d322bf3e9d9c7713bd888517d7348faf1c31622.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)
-rw-r--r-- | libswresample/resample.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libswresample/resample.c b/libswresample/resample.c index 8635bf1bed..c9b112d00e 100644 --- a/libswresample/resample.c +++ b/libswresample/resample.c @@ -300,6 +300,14 @@ fail: return ret; } +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) @@ -391,13 +399,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; |