[FFmpeg-cvslog] r26030 - trunk/libavcodec/ac3enc.c

jbr subversion
Thu Dec 16 04:44:33 CET 2010


Author: jbr
Date: Thu Dec 16 04:44:32 2010
New Revision: 26030

Log:
Add a goto for init failure instead of duplicate calls to ac3_encode_close().

Modified:
   trunk/libavcodec/ac3enc.c

Modified: trunk/libavcodec/ac3enc.c
==============================================================================
--- trunk/libavcodec/ac3enc.c	Thu Dec 16 04:44:29 2010	(r26029)
+++ trunk/libavcodec/ac3enc.c	Thu Dec 16 04:44:32 2010	(r26030)
@@ -1761,19 +1761,20 @@ static av_cold int ac3_encode_init(AVCod
     s->mdct.avctx = avctx;
     ret = mdct_init(&s->mdct, 9);
     if (ret) {
-        ac3_encode_close(avctx);
-        return ret;
+        goto init_fail;
     }
 
     ret = allocate_buffers(avctx);
     if (ret) {
-        ac3_encode_close(avctx);
-        return ret;
+        goto init_fail;
     }
 
     avctx->coded_frame= avcodec_alloc_frame();
 
     return 0;
+init_fail:
+    ac3_encode_close(avctx);
+    return ret;
 }
 
 



More information about the ffmpeg-cvslog mailing list