summaryrefslogtreecommitdiff
path: root/libavfilter/formats.c
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-02-10 18:04:55 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-02-10 18:04:55 +0000
commit93faa9fad75e3038b3ebf5664f524824230a401a (patch)
treeda545f71c38c28621b78ddbf10234715a3cc7b70 /libavfilter/formats.c
parent37e0b997a8d6695abb0dd4bac886a86104d68a3c (diff)
More code factorization
Originally committed as revision 11900 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavfilter/formats.c')
-rw-r--r--libavfilter/formats.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index d7d0322963..b3873d7acb 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -25,10 +25,15 @@
static void merge_ref(AVFilterFormats *ret, AVFilterFormats *a)
{
int i;
+
for(i = 0; i < a->refcount; i ++) {
ret->refs[ret->refcount] = a->refs[i];
*ret->refs[ret->refcount++] = ret;
}
+
+ av_free(a->refs);
+ av_free(a->formats);
+ av_free(a);
}
AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
@@ -58,14 +63,6 @@ AVFilterFormats *avfilter_merge_formats(AVFilterFormats *a, AVFilterFormats *b)
merge_ref(ret, a);
merge_ref(ret, b);
- av_free(a->refs);
- av_free(a->formats);
- av_free(a);
-
- av_free(b->refs);
- av_free(b->formats);
- av_free(b);
-
return ret;
}