From patchwork Tue Nov 23 17:28:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Gaullier X-Patchwork-Id: 31607 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:d206:0:0:0:0:0 with SMTP id q6csp8996770iob; Tue, 23 Nov 2021 09:28:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyK+Z1Fs5tXpw23J5/ohjQAfUBDJJa0TvUZxhY9CE06z9HwdiVXDxT/9CJouOvCEdm2F190 X-Received: by 2002:a17:906:398:: with SMTP id b24mr9932361eja.49.1637688530414; Tue, 23 Nov 2021 09:28:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637688530; cv=none; d=google.com; s=arc-20160816; b=tm6iKgHguuSlXAyQcYaQez4yFDSqhWSXLs7/HAVlWn81pV6Bg2Z7QoA/8tSdwIZ246 49TPSMP6AkHqE4yprDlNcgd1JWH0Uu3dp1NaoFqUMmT52cgIn3jkQPCL4y2ZK/SqBSvj rNRFWWqboeLa9/424E0M+St2RXCV1Kp7ytdrI9Il4OUwiBFL2WC0lFepT1HlHQ9zmHCh QabQxKJX77VJWf0ngg4FbVaflr5uZIhCJXGI4dfxE+HjM4NKgeWm1CrXdGBoKDQnRice 0ib6vGpwYxqZC+mtzq3KGdodthiqteY5CHhgULI0rLIf85lEI+PVfMIqxYen/asrQqKL CvQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=/uuTeOXVa1uTzARjrhEgN2LSmTMbcM63vBlX5rL3RwE=; b=HOwQ4jKXv8SWY/6eFPt5p+fOoefHThr3s+Bqu3WkrSajxxwx5GrAAxFkj0ke0TyIHw rA2inJRTWYGyywMaxkMzDN0blBt2I5JfYSu8rPpS94bhDLxFxZsj5dvfy3p9o4CQVdod iYIfVxpRMNZfiWu3jPzhBjKgs3U2OG/Q8wPnQpcGriOoYPYOpYXJkvb4mVMw+UVbBdun VU0XfVBdWWanZ/wwmswC4dUL0m/N8o/vsceGVpMWh/lA7U/CKqhiJ/ZXcNeF4wKT6ZCH YDpQKKcH4Isbcfit7cEdYd0xFSSSF3T8PRcNdL16JFUVBnJDmUKrwdINhBQLv50ht8F+ MUbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id gc38si28249684ejc.493.2021.11.23.09.28.49; Tue, 23 Nov 2021 09:28:50 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id AF99168AE0F; Tue, 23 Nov 2021 19:28:45 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from srv-infra-1.infra.inf.glb.tvvideoms.com (www.inf.tvvideoms.com [213.205.126.156]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DC55268AE0F for ; Tue, 23 Nov 2021 19:28:38 +0200 (EET) Received: from cji.paris (unknown [172.16.3.159]) by srv-infra-1.infra.inf.glb.tvvideoms.com (Postfix) with ESMTP id 78C5D29344; Tue, 23 Nov 2021 17:28:37 +0000 (UTC) From: Nicolas Gaullier To: ffmpeg-devel@ffmpeg.org Date: Tue, 23 Nov 2021 18:28:28 +0100 Message-Id: <20211123172829.1674-1-nicolas.gaullier@cji.paris> X-Mailer: git-send-email 2.34.0.windows.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/concatdec: copy side data X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Nicolas Gaullier Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: nv20N2Q5Sx8r Fixes mpeg2video stream copy to mpeg muxer. Note: this is a following of 1ec86be79b11. Signed-off-by: Nicolas Gaullier --- libavformat/concatdec.c | 11 +++++++++++ tests/ref/fate/concat-demuxer-extended-lavf-mxf | 2 +- tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 | 2 +- tests/ref/fate/concat-demuxer-simple1-lavf-mxf | 1 + tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 | 1 + tests/ref/fate/concat-demuxer-simple2-lavf-ts | 1 + 6 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c index 8d80e536d1..1e53651945 100644 --- a/libavformat/concatdec.c +++ b/libavformat/concatdec.c @@ -190,6 +190,17 @@ static int copy_stream_props(AVStream *st, AVStream *source_st) st->sample_aspect_ratio = source_st->sample_aspect_ratio; avpriv_set_pts_info(st, 64, source_st->time_base.num, source_st->time_base.den); + // copy side data + for (int i = 0; i < source_st->nb_side_data; i++) { + const AVPacketSideData *sd_src = &source_st->side_data[i]; + uint8_t *dst_data; + + dst_data = av_stream_new_side_data(st, sd_src->type, sd_src->size); + if (!dst_data) + return AVERROR(ENOMEM); + memcpy(dst_data, sd_src->data, sd_src->size); + } + av_dict_copy(&st->metadata, source_st->metadata, 0); return 0; } diff --git a/tests/ref/fate/concat-demuxer-extended-lavf-mxf b/tests/ref/fate/concat-demuxer-extended-lavf-mxf index a3b205539a..edfb4cfcff 100644 --- a/tests/ref/fate/concat-demuxer-extended-lavf-mxf +++ b/tests/ref/fate/concat-demuxer-extended-lavf-mxf @@ -1 +1 @@ -0ea04f40869068b282a67e5b8f2a6127 *tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe +41c317ac3b57addfb93f7ac9d2db822e *tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe diff --git a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 index 9cbc8df831..974fefb64c 100644 --- a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 +++ b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 @@ -1 +1 @@ -88abe27eddff160aafd622ed02c26eb6 *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe +d6da934b59deb2e341de15fc33b002e3 *tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe diff --git a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf index fc8034bd29..dc048f396a 100644 --- a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf +++ b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf @@ -121,4 +121,5 @@ Strings Metadata video|0|37|1.480000|34|1.360000|1|0.040000|24786|212480|K_|1 Strings Metadata 0|mpeg2video|4|video|[0][0][0][0]|0x0000|352|288|0|0|0|0|1|1:1|11:9|yuv420p|8|tv|unknown|unknown|unknown|left|progressive|1|N/A|25/1|25/1|1/25|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|51|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 +CPB properties|0|0|0|49152|-1 1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|1|unknown|16|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|768000|N/A|N/A|N/A|N/A|50|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 diff --git a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 index 59c6372ef2..7ec7eab979 100644 --- a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 +++ b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf_d10 @@ -79,4 +79,5 @@ Strings Metadata audio|1|65280|1.360000|65280|1.360000|1920|0.040000|7680|2074624|K_|1 Strings Metadata 0|mpeg2video|0|video|[0][0][0][0]|0x0000|720|608|0|0|0|0|0|1:1|45:38|yuv422p|5|tv|unknown|unknown|unknown|topleft|tb|1|N/A|25/1|25/1|1/25|0|0.000000|N/A|N/A|30000000|N/A|N/A|N/A|N/A|35|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 +CPB properties|30000000|0|0|1212416|-1 1|pcm_s16le|unknown|audio|[0][0][0][0]|0x0000|s16|48000|2|unknown|16|N/A|0/0|0/0|1/48000|0|0.000000|N/A|N/A|1536000|N/A|N/A|N/A|N/A|35|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0x060A2B340101010501010D001300000000000000000000000000000000000001 diff --git a/tests/ref/fate/concat-demuxer-simple2-lavf-ts b/tests/ref/fate/concat-demuxer-simple2-lavf-ts index b9106f0ea9..2ab1df4939 100644 --- a/tests/ref/fate/concat-demuxer-simple2-lavf-ts +++ b/tests/ref/fate/concat-demuxer-simple2-lavf-ts @@ -213,3 +213,4 @@ video|1|175582|1.950911|171982|1.910911|3600|0.040000|15019|224848|__MPEGTS Stre 0|mp2|unknown|audio|[3][0][0][0]|0x0003|s16p|44100|1|mono|0|N/A|0/0|0/0|1/90000|0|0.000000|N/A|N/A|64000|N/A|N/A|N/A|N/A|89|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|this is stream 0 1|mpeg2video|4|video|[2][0][0][0]|0x0002|352|288|0|0|0|0|1|1:1|11:9|yuv420p|8|tv|unknown|unknown|unknown|left|progressive|1|N/A|25/1|25/1|1/90000|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|N/A|60|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|0|this is stream 1 +CPB properties|0|0|0|49152|-1