changeset 12157:65462b406d6b libavcodec

100l: really fix fft external API init functions
author mru
date Tue, 13 Jul 2010 06:54:31 +0000
parents b1c9654b8d68
children 3212dfbe4c96
files avfft.c
diffstat 1 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/avfft.c	Tue Jul 13 00:49:30 2010 +0000
+++ b/avfft.c	Tue Jul 13 06:54:31 2010 +0000
@@ -26,9 +26,7 @@
 {
     FFTContext *s = av_malloc(sizeof(*s));
 
-    if (s)
-        ff_fft_init(s, nbits, inverse);
-    else
+    if (s && ff_fft_init(s, nbits, inverse))
         av_freep(&s);
 
     return s;
@@ -58,9 +56,7 @@
 {
     FFTContext *s = av_malloc(sizeof(*s));
 
-    if (s)
-        ff_mdct_init(s, nbits, inverse, scale);
-    else
+    if (s && ff_mdct_init(s, nbits, inverse, scale))
         av_freep(&s);
 
     return s;
@@ -97,9 +93,7 @@
 {
     RDFTContext *s = av_malloc(sizeof(*s));
 
-    if (s)
-        ff_rdft_init(s, nbits, trans);
-    else
+    if (s && ff_rdft_init(s, nbits, trans))
         av_freep(&s);
 
     return s;
@@ -126,9 +120,7 @@
 {
     DCTContext *s = av_malloc(sizeof(*s));
 
-    if (s)
-        ff_dct_init(s, nbits, inverse);
-    else
+    if (s && (ff_dct_init(s, nbits, inverse)))
         av_freep(&s);
 
     return s;