From patchwork Thu Aug 9 00:26:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 9941 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp1524263jad; Wed, 8 Aug 2018 17:33:22 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxgbjOcEu/E2Br0AVQ5KfpskvP9pdz/TWuNt9SpMPDYqQZ5bx0wJkPdSDgZ+a4owKBnhBRK X-Received: by 2002:adf:a211:: with SMTP id p17-v6mr3261231wra.196.1533774802104; Wed, 08 Aug 2018 17:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533774802; cv=none; d=google.com; s=arc-20160816; b=Dag7quIEcu2BFjyACbEe7F30e0cDLyM47ux242KqMFZn0i+u0LKMhpjjNvOAD7qt0h 57nim/g656iAhbtgN9eZ5/MMlSxg0VsYXW4Xlo/L3GTkhav8xhBDiQ08HnYANt4POasM 4ULG6IfU+m2AXOcZp+XpQErDgP+RfWKxgENWf+rKjqHqBVsQ3fJNh3xUAYNojd1tv8JD Va8pTM2i5OjDgPzhFw5lkWlq1x8juIgliwmN12o6Qa9CDuFysYyhaBufXHbuzoddhSnk +1hMA0C90mgbZfk/Ui8IsVO/vwwA/on3ey80U62Ua3SYMPMd3Sz9d5o3zqgIpXv/Qwxi J6bA== 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:dkim-signature:delivered-to :arc-authentication-results; bh=NxONjH0fQoTa78Y4uwLpzX6nz1lR+KYeAqkB4NGsSYY=; b=aLhhp6g4f+9Vqk3WmJWRAWL6NdJm6kFpeRw4Zhw/JdwCCwKPYO5KVcBL9OYmxOfQXr Cs2IUEvOZLTYCa+p6PXIRrokOt9306Bgl+AkdtTlSKetriYKcfEXq942EpuljRsi56Ep D0sTGVQZaffLRFIqH8s/r2T/pmwegFZjjpqyAfhtdKmTM5WDgX8OU1MxojScz12WLZBY xIZZ30Lrt5e6WF7WaEIwPrTGQW7ThrVJ/FQjflT1wAqHg4i7wT/PUUfBOKLPcIALVjk9 ERvo+Jf5iVMeSyzyySu0LM8kVHQz3DCfqXbuiuraIha0eTetWcHAvHLHPOA2/TuT63/D LdFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=JEpFROOn; 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 z5-v6si5580607wmd.93.2018.08.08.17.33.21; Wed, 08 Aug 2018 17:33: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; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=JEpFROOn; 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 38E2968A4AE; Thu, 9 Aug 2018 03:32:59 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 67937689E0B for ; Thu, 9 Aug 2018 03:32:52 +0300 (EEST) Received: by mail-pf1-f172.google.com with SMTP id e13-v6so1943596pff.7 for ; Wed, 08 Aug 2018 17:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=WGXg8uWLO8mEcop2Deu14KP2TEpZzcCOSzwfxFxN2jY=; b=JEpFROOnrv+dLBws/Q1yRaJUnOtAmsTCVJ1ZsbGPfZLbQkuZ50uXJCUMgRJCnNtXKa o00Jpevbw9Uahcptn3gEzBuqUD0hg00TNKOq0etcZqrtdyLwqio9vpDU7Gnx5pft9LGW caHaUtx02WhTdTrkGHgQwJ3XqAeJE4iie+Su2owjI8Yka53B1vJAcfs6/Eicw2CCGwP9 MeVOT/8SAS0T1NtY7OG6Lx3CPu1V7A9B8ZWjLp/A3lrLjFrsdrq8Ea/t+MJDMXOpLPX8 /s4P+8/6dbpijhEokgwC4+Y6vi5pDY976dwE92Z2DQ4yKgVLH5B0bJcIX2EmYscYIIsT M2mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WGXg8uWLO8mEcop2Deu14KP2TEpZzcCOSzwfxFxN2jY=; b=nEYwUksaRDDgUnwpKoKL05lFSiI3vugGtKoQQu6j0H0msaFWdsWZdGs0uGZS3iuINl kjoWT5CBV6YyyF1zyxFAa4jXwAEpHDK2KbFZHKKPBIsnhKJ/mTIGeqQscne8Evt6wtPz miIPng4UnYdXt23Vw1tdee12s50oefnDvPcZ734HEflhXG14qpbGWB+w/0UQzGR/+bFR V+uUhGV7EJ9w6K5Vm4C2VT7xXk+fwq9KPM5IViGdqtpESXWD7OO5hLWEQuPoEAXvBXMP w1r10YoxrwgYOmD+r2Rl+cHS/0v53ZeR8kscU3n77xXf17cwiqM9v+EF6UbMaGl5z5wG x7pQ== X-Gm-Message-State: AOUpUlF1Lv0PE+3Mx/lL0v6RK2mkclxrJvwPV+suH4KYQY9XVp0/uOB6 qmSDe8BwKKU3/MdOdZM6qBHBmFFgN18= X-Received: by 2002:a63:2c8e:: with SMTP id s136-v6mr4354874pgs.390.1533774436186; Wed, 08 Aug 2018 17:27:16 -0700 (PDT) Received: from isasi.mtv.corp.google.com ([2620:0:1000:4001:9a31:e971:b584:8af7]) by smtp.gmail.com with ESMTPSA id d191-v6sm9756422pfg.172.2018.08.08.17.27.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Aug 2018 17:27:14 -0700 (PDT) From: isasi-at-google.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Wed, 8 Aug 2018 17:26:42 -0700 Message-Id: <20180809002642.26535-1-isasi@google.com> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog In-Reply-To: References: MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for all sterams (in case of edit lists). 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: Sasi Inguva Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Sasi Inguva Fixes vorbis mp4 audio files, with edit list specified. Since st->skip_samples is not set in case of vorbis , ffmpeg computes the start_time as negative. Signed-off-by: Sasi Inguva --- libavformat/mov.c | 4 ++-- tests/fate/mov.mak | 5 +++++ tests/ref/fate/mov-neg-firstpts-discard-vorbis | 3 +++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 tests/ref/fate/mov-neg-firstpts-discard-vorbis diff --git a/libavformat/mov.c b/libavformat/mov.c index 82cd410a72..c0f90edef7 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3684,9 +3684,9 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) st->index_entries[i].timestamp -= msc->min_corrected_pts; } } - // Start time should be equal to zero or the duration of any empty edits. - st->start_time = empty_edits_sum_duration; } + // Start time should be equal to zero or the duration of any empty edits. + st->start_time = empty_edits_sum_duration; // Update av stream length, if it ends up shorter than the track's media duration st->duration = FFMIN(st->duration, edit_list_dts_entry_end - start_dts); diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index 6f0e28d21e..3d9e4280bb 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -19,6 +19,7 @@ FATE_MOV = fate-mov-3elist \ fate-mov-stream-shorter-than-movie \ FATE_MOV_FFPROBE = fate-mov-neg-firstpts-discard \ + fate-mov-neg-firstpts-discard-vorbis \ fate-mov-aac-2048-priming \ fate-mov-zombie \ fate-mov-init-nonkeyframe \ @@ -89,6 +90,10 @@ fate-mov-bbi-elst-starts-b: CMD = framemd5 -flags +bitexact -acodec aac_fixed -i # Makes sure that the stream start_time is not negative when the first packet is a DISCARD packet with negative timestamp. fate-mov-neg-firstpts-discard: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=start_time -bitexact $(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard.mov +# Makes sure that the VORBIS audio stream start_time is not negative when the first few packets are DISCARD packets +# with negative timestamps (skip_samples is not set for Vorbis, so ffmpeg computes start_time as negative if not specified by demuxer). +fate-mov-neg-firstpts-discard-vorbis: CMD = run ffprobe$(PROGSSUF)$(EXESUF) -show_entries stream=start_time -bitexact $(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard_vorbis.mp4 + # Makes sure that expected frames are generated for mov_neg_first_pts_discard.mov with -vsync 1 fate-mov-neg-firstpts-discard-frames: CMD = framemd5 -flags +bitexact -i $(TARGET_SAMPLES)/mov/mov_neg_first_pts_discard.mov -vsync 1 diff --git a/tests/ref/fate/mov-neg-firstpts-discard-vorbis b/tests/ref/fate/mov-neg-firstpts-discard-vorbis new file mode 100644 index 0000000000..2e295e3b68 --- /dev/null +++ b/tests/ref/fate/mov-neg-firstpts-discard-vorbis @@ -0,0 +1,3 @@ +[STREAM] +start_time=0.000000 +[/STREAM]