]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/flashsvenc.c
avformat: Constify all muxer/demuxers
[ffmpeg] / libavcodec / flashsvenc.c
index 4ac643c036f1d04dc53920ad8a35465febfb852e..0b01550c1e9746271ba09c2f06095e7a4457aed8 100644 (file)
@@ -61,7 +61,6 @@ typedef struct FlashSVContext {
     int             block_width, block_height;
     uint8_t        *encbuffer;
     int             block_size;
-    z_stream        zstream;
     int             last_key_frame;
     uint8_t         tmpblock[3 * 256 * 256];
 } FlashSVContext;
@@ -92,8 +91,6 @@ static av_cold int flashsv_encode_end(AVCodecContext *avctx)
 {
     FlashSVContext *s = avctx->priv_data;
 
-    deflateEnd(&s->zstream);
-
     av_freep(&s->encbuffer);
     av_freep(&s->previous_frame);
 
@@ -112,9 +109,6 @@ static av_cold int flashsv_encode_init(AVCodecContext *avctx)
         return AVERROR_INVALIDDATA;
     }
 
-    // Needed if zlib unused or init aborted before deflateInit
-    memset(&s->zstream, 0, sizeof(z_stream));
-
     s->last_key_frame = 0;
 
     s->image_width  = avctx->width;
@@ -180,7 +174,6 @@ static int encode_bitstream(FlashSVContext *s, const AVFrame *p, uint8_t *buf,
                 ret = compress2(ptr + 2, &zsize, s->tmpblock,
                                 3 * cur_blk_width * cur_blk_height, 9);
 
-                //ret = deflateReset(&s->zstream);
                 if (ret != Z_OK)
                     av_log(s->avctx, AV_LOG_ERROR,
                            "error while compressing block %dx%d\n", i, j);
@@ -252,21 +245,8 @@ static int flashsv_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
     //mark the frame type so the muxer can mux it correctly
     if (I_frame) {
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-        avctx->coded_frame->pict_type      = AV_PICTURE_TYPE_I;
-        avctx->coded_frame->key_frame      = 1;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
         s->last_key_frame = avctx->frame_number;
         ff_dlog(avctx, "Inserting keyframe at frame %d\n", avctx->frame_number);
-    } else {
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-        avctx->coded_frame->pict_type = AV_PICTURE_TYPE_P;
-        avctx->coded_frame->key_frame = 0;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
     }
 
     if (I_frame)
@@ -276,7 +256,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
     return 0;
 }
 
-AVCodec ff_flashsv_encoder = {
+const AVCodec ff_flashsv_encoder = {
     .name           = "flashsv",
     .long_name      = NULL_IF_CONFIG_SMALL("Flash Screen Video"),
     .type           = AVMEDIA_TYPE_VIDEO,