Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-12-13 18:13:01 +0400
committerMichael Niedermayer <michaelni@gmx.at>2013-12-13 18:13:01 +0400
commit8f9569cfacb9f595e1f5a7b45f2d31d9499369fa (patch)
tree4d5a0f1781b5b5949c7f4a95ae114973e407f4da /libavfilter/vf_pullup.c
parentb02d87936b3bc80a5130b3d359a7128c6155bf1a (diff)
avfilter/vf_pullup: Factor free_field_queue() out
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/vf_pullup.c')
-rw-r--r--libavfilter/vf_pullup.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/libavfilter/vf_pullup.c b/libavfilter/vf_pullup.c
index 69e1e91719..d0b910fe1f 100644
--- a/libavfilter/vf_pullup.c
+++ b/libavfilter/vf_pullup.c
@@ -126,6 +126,22 @@ static int alloc_metrics(PullupContext *s, PullupField *f)
return 0;
}
+static void free_field_queue(PullupField *head, PullupField **last)
+{
+ PullupField *f = head;
+ while (f) {
+ av_free(f->diffs);
+ av_free(f->combs);
+ av_free(f->vars);
+ if (f == *last) {
+ av_freep(last);
+ break;
+ }
+ f = f->next;
+ av_freep(&f->prev);
+ };
+}
+
static PullupField *make_field_queue(PullupContext *s, int len)
{
PullupField *head, *f;
@@ -714,21 +730,9 @@ end:
static av_cold void uninit(AVFilterContext *ctx)
{
PullupContext *s = ctx->priv;
- PullupField *f;
int i;
- f = s->head;
- while (f) {
- av_free(f->diffs);
- av_free(f->combs);
- av_free(f->vars);
- if (f == s->last) {
- av_freep(&s->last);
- break;
- }
- f = f->next;
- av_freep(&f->prev);
- };
+ free_field_queue(s->head, &s->last);
for (i = 0; i < FF_ARRAY_ELEMS(s->buffers); i++) {
av_freep(&s->buffers[i].planes[0]);