Browse Source

lavc/videotoolboxenc: Handle out-of-memory and fix memory leak

Signed-off-by: Rick Kern <kernrj@gmail.com>
tags/n3.1
Rick Kern wm4 9 years ago
parent
commit
272dd437bc
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/videotoolboxenc.c

+ 5
- 0
libavcodec/videotoolboxenc.c View File

@@ -706,9 +706,14 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
CFNumberRef interval = CFNumberCreate(kCFAllocatorDefault,
kCFNumberIntType,
&avctx->gop_size);
if (!interval) {
return AVERROR(ENOMEM);
}

status = VTSessionSetProperty(vtctx->session,
kVTCompressionPropertyKey_MaxKeyFrameInterval,
interval);
CFRelease(interval);

if (status) {
av_log(avctx, AV_LOG_ERROR, "Error setting 'max key-frame interval' property: %d\n", status);


Loading…
Cancel
Save