]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/v4l2_m2m_enc.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / v4l2_m2m_enc.c
index 4230a415fd9c301806f92e92502789d8cb11abb9..043fe80c695fff5b4767b9c8226a5c2652f62793 100644 (file)
@@ -296,12 +296,12 @@ static int v4l2_receive_packet(AVCodecContext *avctx, AVPacket *avpkt)
         goto dequeue;
 
     if (!frame->buf[0]) {
-    ret = ff_encode_get_frame(avctx, frame);
-    if (ret < 0 && ret != AVERROR_EOF)
-        return ret;
+        ret = ff_encode_get_frame(avctx, frame);
+        if (ret < 0 && ret != AVERROR_EOF)
+            return ret;
 
-    if (ret == AVERROR_EOF)
-        frame = NULL;
+        if (ret == AVERROR_EOF)
+            frame = NULL;
     }
 
     ret = v4l2_send_frame(avctx, frame);
@@ -421,7 +421,7 @@ static const AVCodecDefault v4l2_m2m_defaults[] = {
 
 #define M2MENC(NAME, LONGNAME, OPTIONS_NAME, CODEC) \
     M2MENC_CLASS(NAME, OPTIONS_NAME) \
-    AVCodec ff_ ## NAME ## _v4l2m2m_encoder = { \
+    const AVCodec ff_ ## NAME ## _v4l2m2m_encoder = { \
         .name           = #NAME "_v4l2m2m" , \
         .long_name      = NULL_IF_CONFIG_SMALL("V4L2 mem2mem " LONGNAME " encoder wrapper"), \
         .type           = AVMEDIA_TYPE_VIDEO, \