]> git.sesse.net Git - ffmpeg/blobdiff - libavfilter/vf_uspp.c
avformat/rtsp: move SDP_MAX_SIZE macro definition to header file
[ffmpeg] / libavfilter / vf_uspp.c
index da4029f4b2c554addc8bfec1388e993ee25d9d7f..6a814350e868d321906ea21381a162f569aba117 100644 (file)
@@ -316,7 +316,7 @@ static int config_input(AVFilterLink *inlink)
     const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
     int i;
 
-    AVCodec *enc = avcodec_find_encoder(AV_CODEC_ID_SNOW);
+    const AVCodec *enc = avcodec_find_encoder(AV_CODEC_ID_SNOW);
     if (!enc) {
         av_log(ctx, AV_LOG_ERROR, "SNOW encoder not found.\n");
         return AVERROR(EINVAL);
@@ -362,9 +362,9 @@ static int config_input(AVFilterLink *inlink)
         avctx_enc->global_quality = 123;
         av_dict_set(&opts, "no_bitstream", "1", 0);
         ret = avcodec_open2(avctx_enc, enc, &opts);
+        av_dict_free(&opts);
         if (ret < 0)
             return ret;
-        av_dict_free(&opts);
         av_assert0(avctx_enc->codec);
     }
 
@@ -468,10 +468,8 @@ static av_cold void uninit(AVFilterContext *ctx)
         av_freep(&uspp->src[i]);
     }
 
-    for (i = 0; i < (1 << uspp->log2_count); i++) {
-        avcodec_close(uspp->avctx_enc[i]);
-        av_freep(&uspp->avctx_enc[i]);
-    }
+    for (i = 0; i < (1 << uspp->log2_count); i++)
+        avcodec_free_context(&uspp->avctx_enc[i]);
 
     av_freep(&uspp->non_b_qp_table);
     av_freep(&uspp->outbuf);