Commit 12733c0c authored by Timo Rothenpieler's avatar Timo Rothenpieler

avcodec/nvenc: remove unused slice offset querying

parent 2537fdc5
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment