On 01/08/2020 12:22, lance.lmw...@gmail.com wrote:
From: Limin Wang <lance.lmw...@gmail.com>

Signed-off-by: Limin Wang <lance.lmw...@gmail.com>
---
  libavcodec/libsvtav1.c | 6 ------
  1 file changed, 6 deletions(-)

diff --git a/libavcodec/libsvtav1.c b/libavcodec/libsvtav1.c
index d34c6b3..eb6043b 100644
--- a/libavcodec/libsvtav1.c
+++ b/libavcodec/libsvtav1.c
@@ -273,23 +273,17 @@ static av_cold int eb_enc_init(AVCodecContext *avctx)
ret = config_enc_params(&svt_enc->enc_params, avctx);
      if (ret < 0) {
-        svt_av1_enc_deinit_handle(svt_enc->svt_handle);
-        svt_enc->svt_handle = NULL;
          av_log(avctx, AV_LOG_ERROR, "Error configuring encoder parameters\n");
          return ret;
      }
svt_ret = svt_av1_enc_set_parameter(svt_enc->svt_handle, &svt_enc->enc_params);
      if (svt_ret != EB_ErrorNone) {
-        svt_av1_enc_deinit_handle(svt_enc->svt_handle);
-        svt_enc->svt_handle = NULL;
          return svt_print_error(avctx, svt_ret, "Error setting encoder 
parameters");
      }
svt_ret = svt_av1_enc_init(svt_enc->svt_handle);
      if (svt_ret != EB_ErrorNone) {
-        svt_av1_enc_deinit_handle(svt_enc->svt_handle);
-        svt_enc->svt_handle = NULL;
          return svt_print_error(avctx, svt_ret, "Error initializing encoder");
      }

Maybe mention in the commit message why this is ok, because it's not 
immediately obvious.  (Because of INIT_CLEANUP.)

LGTM.

Thanks,

- Mark
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to