}
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");
{
AVRnContext *a = avctx->priv_data;
- avcodec_close(a->mjpeg_avctx);
- av_freep(&a->mjpeg_avctx);
+ avcodec_free_context(&a->mjpeg_avctx);
return 0;
}