From 12733c0cbd49077d3aac48007f674f14d1e15ccd Mon Sep 17 00:00:00 2001 From: Timo Rothenpieler Date: Tue, 1 Nov 2022 15:35:54 +0100 Subject: [PATCH] avcodec/nvenc: remove unused slice offset querying --- libavcodec/nvenc.c | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/libavcodec/nvenc.c b/libavcodec/nvenc.c index 11bd21f365..3c6fce391d 100644 --- a/libavcodec/nvenc.c +++ b/libavcodec/nvenc.c @@ -2060,38 +2060,16 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur NvencDynLoadFunctions *dl_fn = &ctx->nvenc_dload_funcs; NV_ENCODE_API_FUNCTION_LIST *p_nvenc = &dl_fn->nvenc_funcs; - uint32_t slice_mode_data; - uint32_t *slice_offsets = NULL; NV_ENC_LOCK_BITSTREAM lock_params = { 0 }; NVENCSTATUS nv_status; int res = 0; enum AVPictureType pict_type; - switch (avctx->codec->id) { - case AV_CODEC_ID_H264: - slice_mode_data = ctx->encode_config.encodeCodecConfig.h264Config.sliceModeData; - break; - case AV_CODEC_ID_H265: - slice_mode_data = ctx->encode_config.encodeCodecConfig.hevcConfig.sliceModeData; - break; - default: - av_log(avctx, AV_LOG_ERROR, "Unknown codec name\n"); - res = AVERROR(EINVAL); - goto error; - } - slice_offsets = av_mallocz(slice_mode_data * sizeof(*slice_offsets)); - - if (!slice_offsets) { - res = AVERROR(ENOMEM); - goto error; - } - lock_params.version = NV_ENC_LOCK_BITSTREAM_VER; lock_params.doNotWait = 0; lock_params.outputBitstream = tmpoutsurf->output_surface; - lock_params.sliceOffsets = slice_offsets; nv_status = p_nvenc->nvEncLockBitstream(ctx->nvencoder, &lock_params); if (nv_status != NV_ENC_SUCCESS) { @@ -2162,16 +2140,12 @@ static int process_output_surface(AVCodecContext *avctx, AVPacket *pkt, NvencSur if (res < 0) goto error2; - av_free(slice_offsets); - return 0; error: timestamp_queue_dequeue(ctx->timestamp_list); error2: - av_free(slice_offsets); - return res; }