1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-29 22:00:58 +02:00

avcodec/amfenc: GOP size check

Fix for the error with an invalid GOP size parameter.
This commit is contained in:
Araz Iusubov 2024-10-28 18:21:05 +01:00 committed by Dmitrii Ovchinnikov
parent 4047b887fc
commit f63f164125
3 changed files with 9 additions and 3 deletions

View File

@ -276,7 +276,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
}
// Picture control properties
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_GOP_SIZE, avctx->gop_size);
if (avctx->gop_size != -1) {
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_GOP_SIZE, avctx->gop_size);
}
// Setup header insertion mode only if this option was defined explicitly
if (ctx->header_insertion_mode != -1) {

View File

@ -517,7 +517,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_DE_BLOCKING_FILTER, !!deblocking_filter);
// Keyframe Interval
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_IDR_PERIOD, avctx->gop_size);
if (avctx->gop_size != -1) {
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_IDR_PERIOD, avctx->gop_size);
}
// Header Insertion Spacing
if (ctx->header_spacing >= 0)

View File

@ -261,7 +261,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
// Picture control properties
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_NUM_GOPS_PER_IDR, ctx->gops_per_idr);
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_GOP_SIZE, avctx->gop_size);
if (avctx->gop_size != -1) {
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_GOP_SIZE, avctx->gop_size);
}
if (avctx->slices > 1) {
AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME, avctx->slices);
}