]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/v4l2_m2m_dec.c
lavc/dvdsubenc: accept palette from options
[ffmpeg] / libavcodec / v4l2_m2m_dec.c
index 0c3fa3a7be46ef86480aec904ed098c33da8a5fa..d666edffe460b0df5bf120f542960bd1ed296564 100644 (file)
@@ -201,6 +201,7 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
     capture->av_codec_id = AV_CODEC_ID_RAWVIDEO;
     capture->av_pix_fmt = avctx->pix_fmt;
 
+    s->avctx = avctx;
     ret = ff_v4l2_m2m_codec_init(priv);
     if (ret) {
         av_log(avctx, AV_LOG_ERROR, "can't configure decoder\n");
@@ -209,7 +210,6 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
 
         return ret;
     }
-    s->avctx = avctx;
 
     return v4l2_prepare_decoder(s);
 }
@@ -217,7 +217,7 @@ static av_cold int v4l2_decode_init(AVCodecContext *avctx)
 static av_cold int v4l2_decode_close(AVCodecContext *avctx)
 {
     V4L2m2mPriv *priv = avctx->priv_data;
-    V4L2m2mContexts = priv->context;
+    V4L2m2mContext *s = priv->context;
     av_packet_unref(&s->buf_pkt);
     return ff_v4l2_m2m_codec_end(priv);
 }
@@ -256,7 +256,7 @@ static const AVOption options[] = {
         .capabilities   = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \
         .caps_internal  = FF_CODEC_CAP_SETS_PKT_DTS, \
         .wrapper_name   = "v4l2m2m", \
-    };
+    }
 
 M2MDEC(h264,  "H.264", AV_CODEC_ID_H264,       "h264_mp4toannexb");
 M2MDEC(hevc,  "HEVC",  AV_CODEC_ID_HEVC,       "hevc_mp4toannexb");