Also make it more readable while at it.
Unified · Split
| @@ -276,6 +276,14 @@ fail: · 275 unmodified lines | ||
| 276 | 276 | return ret; |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | +static void resample_free(ResampleContext **cc){ | |
| 280 | + ResampleContext *c = *cc; | |
| 281 | + if(!c) | |
| 282 | + return; | |
| 283 | + av_freep(&c->filter_bank); | |
| 284 | + av_freep(cc); | |
| 285 | +} | |
| 286 | + | |
| 279 | 287 | static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_rate, int filter_size, int phase_shift, int linear, |
| 280 | 288 | double cutoff0, enum AVSampleFormat format, enum SwrFilterType filter_type, double kaiser_beta, |
| 281 | 289 | double precision, int cheby, int exact_rational) |
| @@ -371,13 +379,6 @@ error: · 89 unmodified lines | ||
| 371 | 379 | return NULL; |
| 372 | 380 | } |
| 373 | 381 | |
| 374 | −static void resample_free(ResampleContext **c){ | |
| 375 | − if(!*c) | |
| 376 | − return; | |
| 377 | − av_freep(&(*c)->filter_bank); | |
| 378 | − av_freep(c); | |
| 379 | −} | |
| 380 | − | |
| 381 | 382 | static int rebuild_filter_bank_with_compensation(ResampleContext *c) |
| 382 | 383 | { |
| 383 | 384 | uint8_t *new_filter_bank; |