]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/api-flac-test: clear callers context with close_*
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Apr 2015 12:24:38 +0000 (14:24 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 20 Apr 2015 12:36:41 +0000 (14:36 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/api-flac-test.c

index 38b261335084b26953137743ce0df884f78e3892..5ca8e8f52951edf307b88e948702abc1966ddf95 100644 (file)
@@ -233,17 +233,17 @@ static int run_test(AVCodec *enc, AVCodec *dec, AVCodecContext *enc_ctx,
     return 0;
 }
 
-static int close_encoder(AVCodecContext *enc_ctx)
+static int close_encoder(AVCodecContext **enc_ctx)
 {
-    avcodec_close(enc_ctx);
-    av_freep(&enc_ctx);
+    avcodec_close(*enc_ctx);
+    av_freep(enc_ctx);
     return 0;
 }
 
-static int close_decoder(AVCodecContext *dec_ctx)
+static int close_decoder(AVCodecContext **dec_ctx)
 {
-    avcodec_close(dec_ctx);
-    av_freep(&dec_ctx);
+    avcodec_close(*dec_ctx);
+    av_freep(dec_ctx);
     return 0;
 }
 
@@ -281,8 +281,8 @@ int main(void)
                 return 1;
             if (run_test(enc, dec, enc_ctx, dec_ctx) != 0)
                 return 1;
-            close_encoder(enc_ctx);
-            close_decoder(dec_ctx);
+            close_encoder(&enc_ctx);
+            close_decoder(&dec_ctx);
         }
     }