From patchwork Sun Sep 18 21:11:34 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Reid X-Patchwork-Id: 618 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp707449vsd; Sun, 18 Sep 2016 14:28:56 -0700 (PDT) X-Received: by 10.28.62.2 with SMTP id l2mr7272666wma.117.1474234136027; Sun, 18 Sep 2016 14:28:56 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id kp8si16088420wjc.257.2016.09.18.14.28.55; Sun, 18 Sep 2016 14:28:55 -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; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id CF6D1689DCD; Mon, 19 Sep 2016 00:28:39 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf0-f193.google.com (mail-pf0-f193.google.com [209.85.192.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id D8DB1689C3E for ; Mon, 19 Sep 2016 00:28:32 +0300 (EEST) Received: by mail-pf0-f193.google.com with SMTP id 6so3293290pfl.2 for ; Sun, 18 Sep 2016 14:28:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=ihLXFevBR/01zoKIHsd5e2kjQcxVsGX70Bz2079a+6k=; b=bWDyDYzRMbMnZqGDlqx777Xi3p7H6y17QAgyVqsJZCqzCd4PT7MERbGz4dtVEpe7Zz d0e36uPnK4f9IGKHPq7k4Vy2pNHmFcHe2V6GeS8qX0KDUJHzVSlrX0QnwC6lHmh+yb3h 9ouVXs0Seezxy1ocPzsI3abKVfYksEsoIKDiPHpqdXtEVMRWgdqsg6DpiLzdPlzaREvR uTexOp/bioXMay3WvnRdZXKq8k1prcCdJl1NfI9lbAIdZImiA1ulkD5oB6NfVsMexS8a VeGnIfcvs3uCkqDYG08bVt/WxXpDVByae3/8Ficnrrd0phkHg2Bwad0blJKoSkkPC8JA nOjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ihLXFevBR/01zoKIHsd5e2kjQcxVsGX70Bz2079a+6k=; b=chiLRqAMdfoCUJV68ULeLhxE+HHBe59MmjvPe6uXYuuC3zoCEuSrNwdzqraFyQQ3YJ FcYb7bwsGVYwZCO2gu0s6SWdJsfLs74a7XyiOEDZYJh3QCcljLjKdk6bxbHpoYoEP1RQ Hc+ZdxvwxQWobrJr561pqvRIaGeItIcICPWP1JKgFC4yUqvisOH+Azcv2NeVL1atKj9F jpNKdwmx56MVLh2eRLG0KMgwY8cuWiXdYTMdGr0Gly1ljay0ilTW4l5NhZ8OAYwZGQ8q Mnypc91aSRMK+qrC9PmpjEieEsP0nUNLJW/ExHRY+p4WZrO8huI5wXNwFnRGEzS2oo2O Kq2Q== X-Gm-Message-State: AE9vXwOUva8YBxSJOpPzXYa1PJ3MFwUSbITm4fgKxtRpmjP8AU4y5B1onSmLOWIq1AWiNQ== X-Received: by 10.98.159.194 with SMTP id v63mr41311616pfk.91.1474233097831; Sun, 18 Sep 2016 14:11:37 -0700 (PDT) Received: from localhost.localdomain (S0106ac228b6e4f8e.vc.shawcable.net. [24.86.216.51]) by smtp.gmail.com with ESMTPSA id i24sm16852910pfi.1.2016.09.18.14.11.37 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 18 Sep 2016 14:11:37 -0700 (PDT) From: Mark Reid To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Sep 2016 14:11:34 -0700 Message-Id: <20160918211135.59228-1-mindmark@gmail.com> X-Mailer: git-send-email 2.9.2 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/mxfdec: use first valid sourceclip found if material track has multiple components 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: Mark Reid MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" hi, This patch fixes a issue with mxf footage having multiple components on a material track. here is a link to the sample footage for the second patches fate test https://dl.dropboxusercontent.com/u/170952/fate/mxf/multiple_components.mxf --- libavformat/mxfdec.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 2.9.2 diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 0b16463..1939761 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1888,7 +1888,11 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) } } - /* TODO: handle multiple source clips */ + /* TODO: handle multiple source clips, only finds first valid source clip */ + if(material_track->sequence->structural_components_count > 1) + av_log(mxf->fc, AV_LOG_WARNING, "material track %d: has %d components\n", + material_track->track_id, material_track->sequence->structural_components_count); + for (j = 0; j < material_track->sequence->structural_components_count; j++) { component = mxf_resolve_sourceclip(mxf, &material_track->sequence->structural_components_refs[j]); if (!component) @@ -1914,6 +1918,8 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) av_log(mxf->fc, AV_LOG_ERROR, "material track %d: no corresponding source track found\n", material_track->track_id); break; } + if(source_track && component) + break; } if (!source_track || !component || !source_package) continue;