diff mbox series

[FFmpeg-devel,v2,2/2] avcodec/libx26[45]: reindent after last commit

Message ID 1640443613-26238-2-git-send-email-lance.lmwang@gmail.com
State Accepted
Commit 63d5b6f9350701a9d1af7d8d532f10d6f6b69039
Headers show
Series [FFmpeg-devel,v2,1/2] avcodec/libx26[45]: add udu_sei option to import user data unregistered SEIs | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc fail Make fate failed

Commit Message

Limin Wang Dec. 25, 2021, 2:46 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

---
 libavcodec/libx264.c | 44 ++++++++++++++++++++++----------------------
 libavcodec/libx265.c | 48 ++++++++++++++++++++++++------------------------
 2 files changed, 46 insertions(+), 46 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 9836818..c5e0231 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -466,29 +466,29 @@  static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
         }
 
         if (x4->udu_sei) {
-        for (int j = 0; j < frame->nb_side_data; j++) {
-            AVFrameSideData *side_data = frame->side_data[j];
-            void *tmp;
-            x264_sei_payload_t *sei_payload;
-            if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)
-                continue;
-            tmp = av_fast_realloc(sei->payloads, &sei_data_size, (sei->num_payloads + 1) * sizeof(*sei_payload));
-            if (!tmp) {
-                free_picture(ctx);
-                return AVERROR(ENOMEM);
-            }
-            sei->payloads = tmp;
-            sei->sei_free = av_free;
-            sei_payload = &sei->payloads[sei->num_payloads];
-            sei_payload->payload = av_memdup(side_data->data, side_data->size);
-            if (!sei_payload->payload) {
-                free_picture(ctx);
-                return AVERROR(ENOMEM);
+            for (int j = 0; j < frame->nb_side_data; j++) {
+                AVFrameSideData *side_data = frame->side_data[j];
+                void *tmp;
+                x264_sei_payload_t *sei_payload;
+                if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)
+                    continue;
+                tmp = av_fast_realloc(sei->payloads, &sei_data_size, (sei->num_payloads + 1) * sizeof(*sei_payload));
+                if (!tmp) {
+                    free_picture(ctx);
+                    return AVERROR(ENOMEM);
+                }
+                sei->payloads = tmp;
+                sei->sei_free = av_free;
+                sei_payload = &sei->payloads[sei->num_payloads];
+                sei_payload->payload = av_memdup(side_data->data, side_data->size);
+                if (!sei_payload->payload) {
+                    free_picture(ctx);
+                    return AVERROR(ENOMEM);
+                }
+                sei_payload->payload_size = side_data->size;
+                sei_payload->payload_type = SEI_TYPE_USER_DATA_UNREGISTERED;
+                sei->num_payloads++;
             }
-            sei_payload->payload_size = side_data->size;
-            sei_payload->payload_type = SEI_TYPE_USER_DATA_UNREGISTERED;
-            sei->num_payloads++;
-        }
         }
     }
 
diff --git a/libavcodec/libx265.c b/libavcodec/libx265.c
index 47d0103..851f099 100644
--- a/libavcodec/libx265.c
+++ b/libavcodec/libx265.c
@@ -545,31 +545,31 @@  static int libx265_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         }
 
         if (ctx->udu_sei) {
-        for (i = 0; i < pic->nb_side_data; i++) {
-            AVFrameSideData *side_data = pic->side_data[i];
-            void *tmp;
-            x265_sei_payload *sei_payload;
-
-            if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)
-                continue;
-
-            tmp = av_fast_realloc(ctx->sei_data,
-                                  &ctx->sei_data_size,
-                                  (sei->numPayloads + 1) * sizeof(*sei_payload));
-            if (!tmp) {
-                av_freep(&x265pic.userData);
-                av_freep(&x265pic.quantOffsets);
-                return AVERROR(ENOMEM);
+            for (i = 0; i < pic->nb_side_data; i++) {
+                AVFrameSideData *side_data = pic->side_data[i];
+                void *tmp;
+                x265_sei_payload *sei_payload;
+
+                if (side_data->type != AV_FRAME_DATA_SEI_UNREGISTERED)
+                    continue;
+
+                tmp = av_fast_realloc(ctx->sei_data,
+                        &ctx->sei_data_size,
+                        (sei->numPayloads + 1) * sizeof(*sei_payload));
+                if (!tmp) {
+                    av_freep(&x265pic.userData);
+                    av_freep(&x265pic.quantOffsets);
+                    return AVERROR(ENOMEM);
+                }
+                ctx->sei_data = tmp;
+                sei->payloads = ctx->sei_data;
+                sei_payload = &sei->payloads[sei->numPayloads];
+                sei_payload->payload = side_data->data;
+                sei_payload->payloadSize = side_data->size;
+                /* Equal to libx265 USER_DATA_UNREGISTERED */
+                sei_payload->payloadType = SEI_TYPE_USER_DATA_UNREGISTERED;
+                sei->numPayloads++;
             }
-            ctx->sei_data = tmp;
-            sei->payloads = ctx->sei_data;
-            sei_payload = &sei->payloads[sei->numPayloads];
-            sei_payload->payload = side_data->data;
-            sei_payload->payloadSize = side_data->size;
-            /* Equal to libx265 USER_DATA_UNREGISTERED */
-            sei_payload->payloadType = SEI_TYPE_USER_DATA_UNREGISTERED;
-            sei->numPayloads++;
-        }
         }
     }