From patchwork Mon Mar 14 18:49:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 34731 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp2414746nkb; Mon, 14 Mar 2022 11:50:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9J6pvQrYiQnGab5puqHOC/M0Xiosk0jBiKEaBwsQ1LXaeudPxCywRlDdSkkxZjZNECgNn X-Received: by 2002:a05:6402:10d5:b0:408:f881:f0f3 with SMTP id p21-20020a05640210d500b00408f881f0f3mr21859213edu.112.1647283810353; Mon, 14 Mar 2022 11:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647283810; cv=none; d=google.com; s=arc-20160816; b=eJg03LJIiDxrvp538CySWQ5oywj2rrSIhGvNSNODVlwUbpcunnLK1OzX8ULVv6u8KN TG9qwgu3i289OilF8s+ZquUeIaKlo3+MItK5xSwAUTgvHBCL6zlpfJPL565PyJrnG2k/ L2OnoJS2MCVx8lJ/fsNLyFS1AvFwzzVLmG4YSEJ356LXfImaHIZiYcbxC7+8SLlbxgk7 5kx2g1xT048QgO+Dj3ombP7mKOEOitKv91JiDkLvlwOIfrex5ofht2A994zmgDQG1DGZ SZFXYCfT6BsEdddmKBSO2FvJK23Ln78tbkbY73nqQJr2KkBpv0CgiznqJuM/AK6HR5O9 baxQ== 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=1Lu13skfZ0VyZSHn61wVdpXDdKyp4cyC54xSva1LvcQ=; b=Ee/PMzhpNP04cWcNQleIEGqaqGAnVm514j6wi4yjca4m2ejOOx6KxxMxo344EEn6mI Vh5EQOCoJxVNQHycZ/WwlI8A/HXGhbZEi+dzt1QXZSNJ+4p8CwB8hWsD3d6w+ia7sAx6 rshMhTodRIJPrppGOjPVDksj1NmaUTd2CekrsI1aMjLru8h3Pa6vaXVwkANEy38Rn26F S6pQmr8wwGKl4BSLw4bYjEp7gy1t2jZEQLnmLPzi2gBD/OUGsNEzK7+UvAvvS1oEfJu0 N+tsKItHhuYD466XAZBOrXNAxoS/euAQw9/OL/G5phMiFy3595mEkeDxhQlviH5AgzCl OiFg== 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 h19-20020a170906591300b006dbc436cc28si3615788ejq.305.2022.03.14.11.50.09; Mon, 14 Mar 2022 11:50:10 -0700 (PDT) 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 EC4C8687FCE; Mon, 14 Mar 2022 20:50:04 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C5D2C68AFCC for ; Mon, 14 Mar 2022 20:49:57 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 28215E67E1; Mon, 14 Mar 2022 19:49:58 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B4pF29nIEl22; Mon, 14 Mar 2022 19:49:55 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 7A6D0E24A8; Mon, 14 Mar 2022 19:49:55 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Mar 2022 19:49:49 +0100 Message-Id: <20220314184950.640-1-cus@passwd.hu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/mxfenc: allow more bits for variable part in uuid generation 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: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: rNQenIQOSMby Also make sure we do not change the product UID. Signed-off-by: Marton Balint --- libavformat/mxfenc.c | 9 +++++---- tests/ref/fate/copy-trac4914 | 2 +- tests/ref/fate/mxf-d10-user-comments | 6 +++--- tests/ref/fate/mxf-opatom-user-comments | 2 +- tests/ref/fate/mxf-reel_name | 2 +- tests/ref/fate/mxf-user-comments | 2 +- tests/ref/fate/time_base | 2 +- tests/ref/lavf/mxf | 6 +++--- tests/ref/lavf/mxf_d10 | 2 +- tests/ref/lavf/mxf_dv25 | 2 +- tests/ref/lavf/mxf_dvcpro50 | 2 +- tests/ref/lavf/mxf_opatom | 2 +- tests/ref/lavf/mxf_opatom_audio | 2 +- 13 files changed, 21 insertions(+), 20 deletions(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 1e87dc6111..ba8e7babfb 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -227,7 +227,8 @@ static const UID mxf_d10_container_uls[] = { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x0D,0x01,0x03,0x01,0x02,0x01,0x06,0x01 }, // D-10 525/50 NTSC 30mb/s }; -static const uint8_t uuid_base[] = { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd }; +static const uint8_t product_uid[] = { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff,0x29,0xbd,0x00,0x0c,0x00,0x02}; +static const uint8_t uuid_base[] = { 0xAD,0xAB,0x44,0x24,0x2f,0x25,0x4d,0xc7,0x92,0xff }; static const uint8_t umid_ul[] = { 0x06,0x0A,0x2B,0x34,0x01,0x01,0x01,0x05,0x01,0x01,0x0D,0x00,0x13 }; /** @@ -424,9 +425,9 @@ typedef struct MXFContext { static void mxf_write_uuid(AVIOContext *pb, enum MXFMetadataSetType type, int value) { - avio_write(pb, uuid_base, 12); + avio_write(pb, uuid_base, 10); avio_wb16(pb, type); - avio_wb16(pb, value); + avio_wb32(pb, value); } static void mxf_write_umid(AVFormatContext *s, int type) @@ -797,7 +798,7 @@ static void mxf_write_identification(AVFormatContext *s) // write product uid mxf_write_local_tag(s, 16, 0x3C05); - mxf_write_uuid(pb, Identification, 2); + avio_write(pb, product_uid, 16); // modification date mxf_write_local_tag(s, 8, 0x3C06); diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914 index 743dc8c055..0ed039bf37 100644 --- a/tests/ref/fate/copy-trac4914 +++ b/tests/ref/fate/copy-trac4914 @@ -1,4 +1,4 @@ -f5150fb82c1bb5a90906fce93dcc3f76 *tests/data/fate/copy-trac4914.mxf +a0f68fa1d9ed5d3030d8244ea0b0299a *tests/data/fate/copy-trac4914.mxf 561721 tests/data/fate/copy-trac4914.mxf #tb 0: 1001/30000 #media_type 0: video diff --git a/tests/ref/fate/mxf-d10-user-comments b/tests/ref/fate/mxf-d10-user-comments index 64a2dec463..1b59beec7c 100644 --- a/tests/ref/fate/mxf-d10-user-comments +++ b/tests/ref/fate/mxf-d10-user-comments @@ -1,4 +1,4 @@ -6dc13ae283257e898e069e5041ac8435 *tests/data/fate/mxf-d10-user-comments.mxf_d10 +8c831b8e01aa4c86e98ab87930d06f3e *tests/data/fate/mxf-d10-user-comments.mxf_d10 3782189 tests/data/fate/mxf-d10-user-comments.mxf_d10 #extradata 0: 34, 0x716b05c4 #tb 0: 1/25 @@ -13,8 +13,8 @@ 0, 3, 4, 1, 150000, 0x9bbe6feb, F=0x0 [FORMAT] TAG:operational_pattern_ul=060e2b34.04010101.0d010201.01010900 -TAG:uid=adab4424-2f25-4dc7-92ff-29bd000c0000 -TAG:generation_uid=adab4424-2f25-4dc7-92ff-29bd000c0001 +TAG:uid=adab4424-2f25-4dc7-92ff-000c00000000 +TAG:generation_uid=adab4424-2f25-4dc7-92ff-000c00000001 TAG:company_name=FATE-company TAG:product_name=FATE-test TAG:product_version_num=0.0.0.0.0 diff --git a/tests/ref/fate/mxf-opatom-user-comments b/tests/ref/fate/mxf-opatom-user-comments index ec4fdff425..14a1cee1f2 100644 --- a/tests/ref/fate/mxf-opatom-user-comments +++ b/tests/ref/fate/mxf-opatom-user-comments @@ -1 +1 @@ -8475bebf3448a972ae89ba59309fd7d6 +d40b64e492133c74faa07e605eb65b2f diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name index d50f0f6990..f3bafcc118 100644 --- a/tests/ref/fate/mxf-reel_name +++ b/tests/ref/fate/mxf-reel_name @@ -1 +1 @@ -ce49a0361d3f79106e1952d387eace51 +75e0ac14d5632d709bd805f1cacb1fbb diff --git a/tests/ref/fate/mxf-user-comments b/tests/ref/fate/mxf-user-comments index 5fcdc5806a..b4c78744b0 100644 --- a/tests/ref/fate/mxf-user-comments +++ b/tests/ref/fate/mxf-user-comments @@ -1 +1 @@ -956f653cd75e1a319569caec9df81b4f +620ae205fefbb6dba74418f357a62c36 diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base index 28815d0828..fd6cac53fc 100644 --- a/tests/ref/fate/time_base +++ b/tests/ref/fate/time_base @@ -1 +1 @@ -78ac0348027b75d73acb8bea14e67a59 +d408aba82d62a90ed7f46a1999b014f1 diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf index 21bf2be513..3f0c74818a 100644 --- a/tests/ref/lavf/mxf +++ b/tests/ref/lavf/mxf @@ -1,9 +1,9 @@ -8938d5c4a396ff1b24d10d4f917ae1c9 *tests/data/lavf/lavf.mxf +9ec1ad83b3400de11ca2f70b3b2d4c4d *tests/data/lavf/lavf.mxf 526393 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x8dddfaab -93ea2cfdf5dda7fffdc0d2fdcfb6a9a4 *tests/data/lavf/lavf.mxf +546eb8c864c0d76c6a9d5303701e9031 *tests/data/lavf/lavf.mxf 561721 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x96ff1b48 -87bdf844ae34bcc758e44419e80177a0 *tests/data/lavf/lavf.mxf +5bd0ce691510e6fae969886c32ad7a14 *tests/data/lavf/lavf.mxf 526393 tests/data/lavf/lavf.mxf tests/data/lavf/lavf.mxf CRC=0x8dddfaab diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10 index 47ef244cb1..4644c3424d 100644 --- a/tests/ref/lavf/mxf_d10 +++ b/tests/ref/lavf/mxf_d10 @@ -1,3 +1,3 @@ -7f16902e28718c2a92bc082400a1c6ee *tests/data/lavf/lavf.mxf_d10 +74269c0a64b19269b127f64f3ce7fa6a *tests/data/lavf/lavf.mxf_d10 5332013 tests/data/lavf/lavf.mxf_d10 tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488 diff --git a/tests/ref/lavf/mxf_dv25 b/tests/ref/lavf/mxf_dv25 index 92509cf1f4..5022f1f62d 100644 --- a/tests/ref/lavf/mxf_dv25 +++ b/tests/ref/lavf/mxf_dv25 @@ -1,3 +1,3 @@ -106e33eb1634595623f0334e92204b65 *tests/data/lavf/lavf.mxf_dv25 +3339def72599c79ad5860c6860cc3123 *tests/data/lavf/lavf.mxf_dv25 3834413 tests/data/lavf/lavf.mxf_dv25 tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52 diff --git a/tests/ref/lavf/mxf_dvcpro50 b/tests/ref/lavf/mxf_dvcpro50 index 2d569b0553..5be1b6875e 100644 --- a/tests/ref/lavf/mxf_dvcpro50 +++ b/tests/ref/lavf/mxf_dvcpro50 @@ -1,3 +1,3 @@ -3d5a303c22666996700f0e8f6e4cb938 *tests/data/lavf/lavf.mxf_dvcpro50 +8494122b2a8e8e5998ace60d4d508d46 *tests/data/lavf/lavf.mxf_dvcpro50 7431213 tests/data/lavf/lavf.mxf_dvcpro50 tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4 diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom index e5c5276835..75f85b604e 100644 --- a/tests/ref/lavf/mxf_opatom +++ b/tests/ref/lavf/mxf_opatom @@ -1,3 +1,3 @@ -b2da9e38d692fd1866101ebae273bfc0 *tests/data/lavf/lavf.mxf_opatom +215ea72602bfeb70e99fc9d79fef073c *tests/data/lavf/lavf.mxf_opatom 4717625 tests/data/lavf/lavf.mxf_opatom tests/data/lavf/lavf.mxf_opatom CRC=0xb13ba2f8 diff --git a/tests/ref/lavf/mxf_opatom_audio b/tests/ref/lavf/mxf_opatom_audio index 97362e7aa4..0e034991c0 100644 --- a/tests/ref/lavf/mxf_opatom_audio +++ b/tests/ref/lavf/mxf_opatom_audio @@ -1,3 +1,3 @@ -c356a3fdd49a1e015961678e837c12bb *tests/data/lavf/lavf.mxf_opatom_audio +633b6d373009416f214edcf456208580 *tests/data/lavf/lavf.mxf_opatom_audio 102969 tests/data/lavf/lavf.mxf_opatom_audio tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff From patchwork Mon Mar 14 18:49:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 34732 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp2414865nkb; Mon, 14 Mar 2022 11:50:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynzYeDSmcflQya5tn5iMYh6iBkvQ2L9paPgNPKUxqmRZwUUTNoMeWv+c33KJDMLgFTAhrG X-Received: by 2002:a05:6402:5171:b0:415:eed0:664a with SMTP id d17-20020a056402517100b00415eed0664amr22105748ede.117.1647283822344; Mon, 14 Mar 2022 11:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647283822; cv=none; d=google.com; s=arc-20160816; b=tpP/kmPSbZ7FJOcNk9ldK69wJrpyNLvgHg5hyADrnj/MG7RtroVEQV7IGRUY1SNFFf nChtRYW1maEkO5wTzUeORBCYdN8ux/Zjp7gkRRsn0UbHxH4+Yf5aNbqJHKEYjFUuh4CX YdC8JUUHUeoi2ooncVXgOhpFUje3UjG0CInKVdG/W8hHDZOM7tKv57GnP3WFxSBq4zb+ ViBzmAMmXXX0VS2fuA82TqzB3+4UdwYIGyP+ptOmpPHvcAZTmr8AQSoMv/NaoDMnswj0 0vaDSd05CzjOxXVhjG8u1sSzz9WH2Hn30fB+PqaX+qsSAXHLLkNyO55apjREw+CD5GeV E5Yg== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=qQBusIN5oCQF+SreEAzv3/PWSI8rN7Y0MrPELDVbJNI=; b=l58XtbvgvKk/jmpFieyoXrL+jvF2DfKTEv/YU8XJmI9C/yDWJ41nvdPLYh/7DxsoNo ZoHrrXFHz1prtL7Dkv3ni1UHu69RQM5req+SKO+f++L7l/FDlus3LKBHp5MEcqhX4VGa ZOgWgoVjIHACZ0+3xtM+FcILFM3EZtzyjTWvRlY2VELgyuEHYq9DrfCvLekqnNEcP6/8 hqa+yaWnV4fkR//YQBObS0DbNp7pyBRp+etKk/BA4p2Re5Ctm4f/c1FgL31eHXcXcNE8 wVEkjKVS4gp6ybAqt6zeydLBbByn2dTvifWj0Zk2SuRjxJ+QDOAL+OM32wWmZS/vMAbC ZTNw== 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 sd14-20020a1709076e0e00b006db141db8absi11062316ejc.323.2022.03.14.11.50.21; Mon, 14 Mar 2022 11:50:22 -0700 (PDT) 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 151D368B120; Mon, 14 Mar 2022 20:50:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2DE8A68B08A for ; Mon, 14 Mar 2022 20:50:01 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 84BD9E67E2; Mon, 14 Mar 2022 19:50:01 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nNyXtuqTcXsV; Mon, 14 Mar 2022 19:49:59 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id E5BFAE24A8; Mon, 14 Mar 2022 19:49:58 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Mon, 14 Mar 2022 19:49:50 +0100 Message-Id: <20220314184950.640-2-cus@passwd.hu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220314184950.640-1-cus@passwd.hu> References: <20220314184950.640-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avformat/mxfenc: do not write index tables with the same InstanceUID 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: Marton Balint Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 7vfe63wya9MB Only index tables repeating previous index tables should use the same InstaceUID. Use the index start position when generating the InstanceUID to fix this. Signed-off-by: Marton Balint --- libavformat/mxfenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index ba8e7babfb..5b972eadaa 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1757,7 +1757,7 @@ static void mxf_write_index_table_segment(AVFormatContext *s) // instance id mxf_write_local_tag(s, 16, 0x3C0A); - mxf_write_uuid(pb, IndexTableSegment, 0); + mxf_write_uuid(pb, IndexTableSegment, mxf->last_indexed_edit_unit); // index edit rate mxf_write_local_tag(s, 8, 0x3F0B);