examples/vaapi_encode: Remove redundancy check when free context.
authorJun Zhao <jun.zhao@intel.com>
Thu, 11 Jan 2018 05:21:58 +0000 (13:21 +0800)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 12 Jan 2018 11:31:55 +0000 (12:31 +0100)
avcodec_free_context have handle NULL pointer case, so caller doesn't
need to check the NULL before call this function.

Signe-off-by: Jun Zhao <jun.zhao@intel.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
doc/examples/vaapi_encode.c

index f66a4a7..6425b1c 100644 (file)
@@ -217,8 +217,7 @@ close:
         fclose(fout);
     av_frame_free(&sw_frame);
     av_frame_free(&hw_frame);
-    if (avctx)
-        avcodec_free_context(&avctx);
+    avcodec_free_context(&avctx);
     av_buffer_unref(&hw_device_ctx);
 
     return err;