[FFmpeg-devel] [PATCH 2/2] avcodec/videotoolboxenc: reindent after previous commit

Thomas Guillem thomas at gllm.fr
Wed Jul 4 10:05:23 EEST 2018


---
 libavcodec/videotoolboxenc.c | 72 ++++++++++++++++++------------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
index aa9aae7e05..050e5cefee 100644
--- a/libavcodec/videotoolboxenc.c
+++ b/libavcodec/videotoolboxenc.c
@@ -1020,45 +1020,45 @@ static int vtenc_create_encoder(AVCodecContext   *avctx,
     if (vtctx->codec_id == AV_CODEC_ID_H264) {
         // kVTCompressionPropertyKey_DataRateLimits is not available for HEVC
         if (max_rate > 0) {
-        bytes_per_second_value = max_rate >> 3;
-        bytes_per_second = CFNumberCreate(kCFAllocatorDefault,
-                                          kCFNumberSInt64Type,
-                                          &bytes_per_second_value);
-        if (!bytes_per_second) {
-            return AVERROR(ENOMEM);
-        }
-        one_second_value = 1;
-        one_second = CFNumberCreate(kCFAllocatorDefault,
-                                    kCFNumberSInt64Type,
-                                    &one_second_value);
-        if (!one_second) {
-            CFRelease(bytes_per_second);
-            return AVERROR(ENOMEM);
-        }
-        nums[0] = (void *)bytes_per_second;
-        nums[1] = (void *)one_second;
-        data_rate_limits = CFArrayCreate(kCFAllocatorDefault,
-                                         (const void **)nums,
-                                         2,
-                                         &kCFTypeArrayCallBacks);
-
-        if (!data_rate_limits) {
+            bytes_per_second_value = max_rate >> 3;
+            bytes_per_second = CFNumberCreate(kCFAllocatorDefault,
+                                              kCFNumberSInt64Type,
+                                              &bytes_per_second_value);
+            if (!bytes_per_second) {
+                return AVERROR(ENOMEM);
+            }
+            one_second_value = 1;
+            one_second = CFNumberCreate(kCFAllocatorDefault,
+                                        kCFNumberSInt64Type,
+                                        &one_second_value);
+            if (!one_second) {
+                CFRelease(bytes_per_second);
+                return AVERROR(ENOMEM);
+            }
+            nums[0] = (void *)bytes_per_second;
+            nums[1] = (void *)one_second;
+            data_rate_limits = CFArrayCreate(kCFAllocatorDefault,
+                                             (const void **)nums,
+                                             2,
+                                             &kCFTypeArrayCallBacks);
+
+            if (!data_rate_limits) {
+                CFRelease(bytes_per_second);
+                CFRelease(one_second);
+                return AVERROR(ENOMEM);
+            }
+            status = VTSessionSetProperty(vtctx->session,
+                                          kVTCompressionPropertyKey_DataRateLimits,
+                                          data_rate_limits);
+
             CFRelease(bytes_per_second);
             CFRelease(one_second);
-            return AVERROR(ENOMEM);
-        }
-        status = VTSessionSetProperty(vtctx->session,
-                                      kVTCompressionPropertyKey_DataRateLimits,
-                                      data_rate_limits);
+            CFRelease(data_rate_limits);
 
-        CFRelease(bytes_per_second);
-        CFRelease(one_second);
-        CFRelease(data_rate_limits);
-
-        if (status) {
-            av_log(avctx, AV_LOG_ERROR, "Error setting max bitrate property: %d\n", status);
-            return AVERROR_EXTERNAL;
-        }
+            if (status) {
+                av_log(avctx, AV_LOG_ERROR, "Error setting max bitrate property: %d\n", status);
+                return AVERROR_EXTERNAL;
+            }
         }
 
         if (profile_level) {
-- 
2.18.0



More information about the ffmpeg-devel mailing list