From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 22C604C04F for ; Mon, 6 Oct 2025 14:31:53 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'5ju5HyA2PMyAoUQKnuwQy92n9V+KLFzPOg+7rCMBUrA=', expected b'PzahnIu3Ju7U6+R46Dar62D6MbWFUaAYH7Pr67S+lmY=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759761105; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=5ju5HyA2PMyAoUQKnuwQy92n9V+KLFzPOg+7rCMBUrA=; b=aWwbbmvwds//fa3U+q8EBSjR418N/USxoSscGxD8ExnKJlJ80ns3KvyutvgR3NWCHtocn KM++vXFp+Qeq5iRP/SsmpL3tZ01bISIViBU0YXFHoKeNITdEF4uorlOg5wqUpn/hoyYxVHs nWqpOX4tRZkAd+loRO7tVMFYbHoWRYPBlwnIBVcak3e4dOzMQtHTm1IaboyDlJahv2Awe90 AiLvqRgcQK5Q6hK0fhKrbd1eYlwDxdrq9/drO76ikwEYeJIgQEXGak2cIOcNuKuEos5Kg7r iCJaSv4tC2zQYqMosJLg/tVI6v1jra8fx/cjN1GE0BjSyVothPJmfOgmF3wQ== Received: from [172.18.0.2] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 8DD1368F072; Mon, 6 Oct 2025 17:31:45 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1759761091; b=DlMQKuhohlVeGqU76kn91A8Mas5J8EyE85uCJHAprO4seQzYy6RAdFDdzfW93jldQ2XNk TSs3NZW/+1imyGHQPQ0FD9m9BHfoZ2d2xuLI2P0YFr487Zoj2cFlnkF16pT0kY1+KVVqiWy Wa4nm80oaBxopGI6Qcie8pYGbmG9J4/hwHj/iFrEMjGNSn+De3Uyepk07kZtAnpH0hRo1vc 5DSpoId2a0DyxqKjyes4pZQzqF14U3z6OxGn8uxekr2Zp1Ceaqt6D7+HBotmkMI3G7s6Epm Q44ugE+67NuUGXdNUaBiU/vBpToMqNWEODueThB4s+O8AehkuxylarkJe3UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1759761091; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=kdCBZ87YJLTwGQ23crzqPjvsyPGtyKY7oWAdfuO1AE8=; b=CqA5z2mG6hCAP+CyUB9KIv9u08wpgdBszvkpOdP1NrePs7oMRyAY8lATalAQYrbWQKNnv eLRSUEBDRJ6LfsJY39FomS717vdZupxfUv8/2L8fMyGpb/8v4tFXwjgmeWvjVpD2yp9a3Yo 0wYBqduzIk4rss/KXyVyGxcBrCZbfQG+8vQY7lDtFEw1mPVZQ62J9WTw3DEWJO+i7ZYTCLW 85SDF1W75jELis7BnsbTABwopDAo5jde/InRSjh0oeT7qgjuXq3lMoUgy04SU+fWWaM8SlS 4zrKSd1pQprysW/MtXTfd9CidODh/7ZD1BRMwn4Y7iPqfz0wGKYg41w2IJJg== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759761083; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=PzahnIu3Ju7U6+R46Dar62D6MbWFUaAYH7Pr67S+lmY=; b=0l+Okbr7El5bYvP60/k4bQ5ovyOjx4e2t76QtKDW+el0cplraa2lSQjx2N1n2AV3nekZT rbYsOwz3JUqiEYRi/k8nLMK/qthcwnivxSkSnA5INjZPSBB8rDIKQZ8F5r8xevjnbQXBf1g vfOopyVwgDUmTFoZkIyezmNjz68+TBgDqYUZeHNTMY8iuepEoqqamUPoJrP1dfi+Uj+0i1n 7h7zhFagQy5WnRnNWOFbwz4VwrG27O4G60MlrfJJtJk+PU7zAuz1/bS20nyFei6Tdo3g4By v31wFDpgq386JIvvQQqazLjuMZAJPQBcGUsFgjqyTnCdR5xwDTWdaXnHBE2g== Received: from be50bb5a3685 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 8F39268CF2E for ; Mon, 6 Oct 2025 17:31:23 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Mon, 06 Oct 2025 14:31:23 -0000 Message-ID: <175976108368.65.754313117503418314@bf249f23a2c8> Message-ID-Hash: IZAJXTGYJ5I5VOZG2DJ375ZYRFPKO3GV X-Message-ID-Hash: IZAJXTGYJ5I5VOZG2DJ375ZYRFPKO3GV X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] Fix incorrect extraction of Origin (PR #20656) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: anders-mjoll via ffmpeg-devel Cc: anders-mjoll Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20656 opened by anders-mjoll URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20656 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20656.patch The code that attempted to extract origin (4B.02) was put in the wrong metadata handler and was also read as the wrong integer type. According ST 377-1 Origin is of type "Position" (Int64) in the Timeline Track, not a 8 bit unsigned integer in the Sequence. >>From a958b6b8ef9e102b4846fd52882a9983600894ee Mon Sep 17 00:00:00 2001 From: Anders Rein Date: Mon, 6 Oct 2025 16:23:45 +0200 Subject: [PATCH] Fix incorrect extraction of Origin The code that attempted to extract origin (4B.02) was put in the wrong metadata handler and was also read as the wrong integer type. According ST 377-1 Origin is of type "Position" (Int64) in the Timeline Track, not a 8 bit unsigned integer in the Sequence. --- libavformat/mxfdec.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index dc5dff651a..59b9b43a22 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -145,7 +145,6 @@ typedef struct MXFSequence { UID *structural_components_refs; int structural_components_count; int64_t duration; - uint8_t origin; } MXFSequence; typedef struct MXFTimecodeComponent { @@ -189,6 +188,7 @@ typedef struct { int body_sid; MXFWrappingScheme wrapping; int edit_units_per_packet; /* how many edit units to read at a time (PCM, ClipWrapped) */ + int64_t origin; } MXFTrack; typedef struct MXFDescriptor { @@ -1155,6 +1155,9 @@ static int mxf_read_track(void *arg, AVIOContext *pb, int tag, int size, UID uid track->edit_rate.num = avio_rb32(pb); track->edit_rate.den = avio_rb32(pb); break; + case 0x4b02: + track->origin = avio_rb64(pb); + break; case 0x4803: avio_read(pb, track->sequence_ref, 16); break; @@ -1172,9 +1175,6 @@ static int mxf_read_sequence(void *arg, AVIOContext *pb, int tag, int size, UID case 0x0201: avio_read(pb, sequence->data_definition_ul, 16); break; - case 0x4b02: - sequence->origin = avio_r8(pb); - break; case 0x1001: return mxf_read_strong_ref_array(pb, &sequence->structural_components_refs, &sequence->structural_components_count); @@ -3025,11 +3025,11 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) } } sti->need_parsing = AVSTREAM_PARSE_HEADERS; - if (material_track->sequence->origin) { - av_dict_set_int(&st->metadata, "material_track_origin", material_track->sequence->origin, 0); + if (material_track->origin) { + av_dict_set_int(&st->metadata, "material_track_origin", material_track->origin, 0); } - if (source_track->sequence->origin) { - av_dict_set_int(&st->metadata, "source_track_origin", source_track->sequence->origin, 0); + if (source_track->origin) { + av_dict_set_int(&st->metadata, "source_track_origin", source_track->origin, 0); } if (descriptor->aspect_ratio.num && descriptor->aspect_ratio.den) sti->display_aspect_ratio = descriptor->aspect_ratio; -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org