Commit 6124cbdc authored by Limin Wang's avatar Limin Wang

avcodec/adpcmenc: Add FF_CODEC_CAP_INIT_CLEANUP

then we can remove adpcm_encode_close() in adpcm_encode_init() if have failed.
so the goto error lable will be unnecessary and can be removed later.
Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
parent 43052393
...@@ -146,7 +146,6 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx) ...@@ -146,7 +146,6 @@ static av_cold int adpcm_encode_init(AVCodecContext *avctx)
return 0; return 0;
error: error:
adpcm_encode_close(avctx);
return ret; return ret;
} }
...@@ -717,6 +716,7 @@ AVCodec ff_ ## name_ ## _encoder = { \ ...@@ -717,6 +716,7 @@ AVCodec ff_ ## name_ ## _encoder = { \
.encode2 = adpcm_encode_frame, \ .encode2 = adpcm_encode_frame, \
.close = adpcm_encode_close, \ .close = adpcm_encode_close, \
.sample_fmts = sample_fmts_, \ .sample_fmts = sample_fmts_, \
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP, \
} }
ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, sample_fmts_p, "ADPCM IMA QuickTime"); ADPCM_ENCODER(AV_CODEC_ID_ADPCM_IMA_QT, adpcm_ima_qt, sample_fmts_p, "ADPCM IMA QuickTime");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment