diff mbox series

[FFmpeg-devel,04/25] fftools/ffmpeg_mux_init: remove a redundant check

Message ID 20230413141223.17245-4-anton@khirnov.net
State Accepted
Commit a0452ee83750afe0e279d3cbe7a678e2a72f93b4
Headers show
Series [FFmpeg-devel,01/25] fftools/ffmpeg_mux_init: move new_output_stream() lower in the file | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov April 13, 2023, 2:12 p.m. UTC
---
 fftools/ffmpeg_mux_init.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 06a6b3fd2d..e3d66b9897 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -917,18 +917,16 @@  static int streamcopy_init(const Muxer *mux, const OptionsContext *o,
         }
     }
 
-    if (ist->st->nb_side_data) {
-        for (int i = 0; i < ist->st->nb_side_data; i++) {
-            const AVPacketSideData *sd_src = &ist->st->side_data[i];
-            uint8_t *dst_data;
-
-            dst_data = av_stream_new_side_data(ost->st, sd_src->type, sd_src->size);
-            if (!dst_data) {
-                ret = AVERROR(ENOMEM);
-                goto fail;
-            }
-            memcpy(dst_data, sd_src->data, sd_src->size);
+    for (int i = 0; i < ist->st->nb_side_data; i++) {
+        const AVPacketSideData *sd_src = &ist->st->side_data[i];
+        uint8_t *dst_data;
+
+        dst_data = av_stream_new_side_data(ost->st, sd_src->type, sd_src->size);
+        if (!dst_data) {
+            ret = AVERROR(ENOMEM);
+            goto fail;
         }
+        memcpy(dst_data, sd_src->data, sd_src->size);
     }
 
 #if FFMPEG_ROTATION_METADATA