diff mbox series

[FFmpeg-devel,v6,3/5] fftools/ffmpeg: Use the new av_stream_add_coded_side_data()

Message ID 20200113185459.8908-4-nicolas.gaullier@cji.paris
State New
Headers show
Series Fix mpeg1/2 stream copy
Related show

Checks

Context Check Description
andriy/ffmpeg-patchwork pending
andriy/ffmpeg-patchwork success Applied patch
andriy/ffmpeg-patchwork success Configure finished
andriy/ffmpeg-patchwork success Make finished
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Nicolas Gaullier Jan. 13, 2020, 6:54 p.m. UTC
This code is now shared with avformat_find_stream_info().
---
 fftools/ffmpeg.c | 16 +++-------------
 1 file changed, 3 insertions(+), 13 deletions(-)
diff mbox series

Patch

diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index 6bcd7b94d2..a513e9f3cc 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -3534,19 +3534,9 @@  static int init_output_stream(OutputStream *ost, char *error, int error_len)
         if (ret < 0)
             return ret;
 
-        if (ost->enc_ctx->nb_coded_side_data) {
-            int i;
-
-            for (i = 0; i < ost->enc_ctx->nb_coded_side_data; i++) {
-                const AVPacketSideData *sd_src = &ost->enc_ctx->coded_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)
-                    return AVERROR(ENOMEM);
-                memcpy(dst_data, sd_src->data, sd_src->size);
-            }
-        }
+        ret = av_stream_add_coded_side_data(ost->st, ost->enc_ctx);
+        if (ret < 0)
+            return ret;
 
         /*
          * Add global input side data. For now this is naive, and copies it