]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/avrndec.c
avcodec/snowdec: Use ff_snow_common_init() directly
[ffmpeg] / libavcodec / avrndec.c
index 104ff2d9048ee12f0f1d0467bbd27b59bd43717f..f4ec490de5e3107ec0c5224fca9f4af09ee39fae 100644 (file)
@@ -46,7 +46,7 @@ static av_cold int init(AVCodecContext *avctx)
     }
 
     if(a->is_mjpeg) {
-        AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG);
+        const AVCodec *codec = avcodec_find_decoder(AV_CODEC_ID_MJPEG);
         AVDictionary *thread_opt = NULL;
         if (!codec) {
             av_log(avctx, AV_LOG_ERROR, "MJPEG codec not found\n");
@@ -91,8 +91,7 @@ static av_cold int end(AVCodecContext *avctx)
 {
     AVRnContext *a = avctx->priv_data;
 
-    avcodec_close(a->mjpeg_avctx);
-    av_freep(&a->mjpeg_avctx);
+    avcodec_free_context(&a->mjpeg_avctx);
 
     return 0;
 }