History

avcodec/amfenc: GOP size check

Fix for the error with an invalid GOP size parameter.

Araz Iusubov committed 2 years ago

Commit f63f1641 parent 4047b883 files · +9 −3Browse files

Unified · Split

3 files
  1. libavcodec/amfenc_av1.c +3 −1
  2. libavcodec/amfenc_h264.c +3 −1
  3. libavcodec/amfenc_hevc.c +3 −1
libavcodec/amfenc_av1.c+3−1
@@ -276,7 +276,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 275 unmodified lines
276 }276 }
277 277
278 // Picture control properties278 // Picture control properties
279 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_GOP_SIZE, avctx->gop_size);279 if (avctx->gop_size != -1) {
280 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_AV1_GOP_SIZE, avctx->gop_size);
281 }
280 282
281 // Setup header insertion mode only if this option was defined explicitly283 // Setup header insertion mode only if this option was defined explicitly
282 if (ctx->header_insertion_mode != -1) {284 if (ctx->header_insertion_mode != -1) {
libavcodec/amfenc_h264.c+3−1
@@ -517,7 +517,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 516 unmodified lines
517 AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_DE_BLOCKING_FILTER, !!deblocking_filter);517 AMF_ASSIGN_PROPERTY_BOOL(res, ctx->encoder, AMF_VIDEO_ENCODER_DE_BLOCKING_FILTER, !!deblocking_filter);
518 518
519 // Keyframe Interval519 // Keyframe Interval
520 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_IDR_PERIOD, avctx->gop_size);520 if (avctx->gop_size != -1) {
521 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_IDR_PERIOD, avctx->gop_size);
522 }
521 523
522 // Header Insertion Spacing524 // Header Insertion Spacing
523 if (ctx->header_spacing >= 0)525 if (ctx->header_spacing >= 0)
libavcodec/amfenc_hevc.c+3−1
@@ -261,7 +261,9 @@ FF_ENABLE_DEPRECATION_WARNINGS · 260 unmodified lines
261 261
262 // Picture control properties262 // Picture control properties
263 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_NUM_GOPS_PER_IDR, ctx->gops_per_idr);263 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_NUM_GOPS_PER_IDR, ctx->gops_per_idr);
264 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_GOP_SIZE, avctx->gop_size);264 if (avctx->gop_size != -1) {
265 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_GOP_SIZE, avctx->gop_size);
266 }
265 if (avctx->slices > 1) {267 if (avctx->slices > 1) {
266 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME, avctx->slices);268 AMF_ASSIGN_PROPERTY_INT64(res, ctx->encoder, AMF_VIDEO_ENCODER_HEVC_SLICES_PER_FRAME, avctx->slices);
267 }269 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t