From patchwork Sun May 27 19:21:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 9109 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:11c:0:0:0:0:0 with SMTP id c28-v6csp1188652jad; Sun, 27 May 2018 12:22:18 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqnugRUpV1b3CHhO5MkXju55uHfeJWsbYT6js9JVAAoVPcPfO5j6lXuwzYvtU4L1hKdHRry X-Received: by 2002:adf:8386:: with SMTP id 6-v6mr7905045wre.119.1527448938421; Sun, 27 May 2018 12:22:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527448938; cv=none; d=google.com; s=arc-20160816; b=Lph/HNl0o9gYJAXZGi6DEdaSf54Af6A27+PeiiMziPWuRlN9eL8yTEqkPF+E3X+lDQ fRqTsMcDZ3RQFAFcQ0TQjrVx0cnxMNJB4m1RQwOrqmCN0JMVeiZnRQvD8WZiBWUtffjU XoN1L50jzK+rt+9271a9NbWP0ih8AogVWiCy988WD82PKKF4ICmualixIA5/iXrWIkC8 YvbfQHZM0Yb4tMuQjbmrv9KnZhopDMnrztqTzUqR5YQzIzLyKIPhoA/YSqa1efgjGFqH thAjuMWiCrhEW9rsRwGb8Pga/7FaIf0UrduSOvdIfzj1HMXunxsUruMk+GIpuTG4oC/U tHnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=W/dCalo3Dq1CkUnsYhG16oPCK2+fweDqO1VRIy/q9YE=; b=FcDhv/bTAE6ktxoB62KGIJ1XPReTl0WiYrK9IHsSz1+HUZVYhmjQlTaSVzBIcgmB/F jYhBBVGm79oZAo+6itKQ6oOLp3T9XSXmXVcZ/ycEP2Z2FJeIWc2A/6OpXFbCDWSJWMIV gQsZM+gfQLACBAck1wRi22La8WkRq6IKsw3sa4CBsDFEJM8/NednMQ/IRNBC/zCtEhuk PAtaXbnLE5mhC8WQDKIwP+2+oF+JUvsANqKb5CKodCVJg11oF98mvi42/G+kbqCrUaQi lnakiYJljXpT6hD4+kgQIQ9Kjdq2zeirbQqZ0dTzKPvWl232QmfAJdfHWZbl1XLAdibw PWkw== 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 7-v6si2873505wrs.415.2018.05.27.12.22.18; Sun, 27 May 2018 12:22:18 -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 C5A8A68A2DE; Sun, 27 May 2018 22:21:24 +0300 (EEST) 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 CE74B689E0B for ; Sun, 27 May 2018 22:21:22 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 4A369E11CE; Sun, 27 May 2018 21:22:06 +0200 (CEST) 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 PjYtPYv2PC12; Sun, 27 May 2018 21:22:05 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 61321E0F8F; Sun, 27 May 2018 21:22:05 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 27 May 2018 21:21:53 +0200 Message-Id: <20180527192154.25996-4-cus@passwd.hu> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180527192154.25996-1-cus@passwd.hu> References: <20180527192154.25996-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 4/5] avformat/mxfdec: fix data_essence_descriptor matching logic X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Marton Balint --- libavformat/mxfdec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index bd46572e48..a62021b0d7 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2354,12 +2354,12 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->need_parsing = AVSTREAM_PARSE_FULL; } } else if (st->codecpar->codec_type == AVMEDIA_TYPE_DATA) { - int codec_id = mxf_get_codec_ul(mxf_data_essence_container_uls, - essence_container_ul)->id; - if (codec_id >= 0 && - codec_id < FF_ARRAY_ELEMS(mxf_data_essence_descriptor)) { + int index; + container_ul = mxf_get_codec_ul(mxf_data_essence_container_uls, essence_container_ul); + index = container_ul - mxf_data_essence_container_uls; + if (index < FF_ARRAY_ELEMS(mxf_data_essence_descriptor)) { av_dict_set(&st->metadata, "data_type", - mxf_data_essence_descriptor[codec_id], 0); + mxf_data_essence_descriptor[index], 0); } } if (descriptor->extradata) {