From patchwork Thu Aug 9 15:47:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 9947 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp2355714jad; Thu, 9 Aug 2018 08:48:16 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxFRFS9lA5jRRD4JIpA4hXU9CqFaV7yvp8lG0lpkNUCOc5cwESVYqFG/w0PV6o+f4sBxnkN X-Received: by 2002:a1c:d0ce:: with SMTP id h197-v6mr1879362wmg.43.1533829696331; Thu, 09 Aug 2018 08:48:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533829696; cv=none; d=google.com; s=arc-20160816; b=s3Pelsh0GGx0zoQv6wCRcvLaYYtnpJfnt3rfXVV0qE+eFvSwQnqYh+UtqYGlIE6w6+ WIjy85bBvBwm435Kxv8VwEDg7/ASIviQKZ8JugSC2aLvehga9zJilgUV8aLEpdP3kBhe s6BaQ6pCOGuwiRnCJ4pEgb3n8ohtGdLEHeomfb+JTuJ6c/Ty0maVbaxrNS/NNtmPLdgt AzZYHkxBjK7gBqNzgb6Tci3rAy4KeLIgiHWqDCZg1OsylZY53vm+ir/xEGzrWuDGvNEL CjKluMC63RJ9cqwN+Nng6ocjlfqhRZW7s8Z3l3Wf+WDuJu/vv2Mef8TA8CgNYZ2gE1cP mkfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:delivered-to:arc-authentication-results; bh=uGFtj+xKaBZxv+fzVZr/ecD49NvUrhOpGWN4OKACd/o=; b=yMCFeLx61UBCFP9wKqOhYW0tW8eUtI+qZC9tIwZjJNEV6OfTASy5jJD0tiyQ7I326s S6hDvsW4enP/2mGRnDZDwLnDVWls0guIFh0eYj7efHqSkSNNdKASnWnL3m5BVMRDfCi9 wf0u7jW2Ggma324NBKZ/ZicP6zG4UhIMrad1cUY7IxieV9OBmKmSSXEsh1lqFbBy2wPi cUOm42UQBoh/Oqex2iZY+b3dSbgyXQXvylN7fjcYqSa7Wzul12iuTKJ4Y7KtamxhCSNy IF6hHwpDiLFtwNc8+xl4/ocJHAepdesawN2epCW56J5k2ee1iF9+hqdE7ZVbE4FShZyJ beMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=lr7gaRpC; 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 w22-v6si6475053wrc.334.2018.08.09.08.48.15; Thu, 09 Aug 2018 08:48:16 -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=lr7gaRpC; 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 AFB1868A491; Thu, 9 Aug 2018 18:47:51 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E9E8068A339 for ; Thu, 9 Aug 2018 18:47:45 +0300 (EEST) Received: by mail-wr1-f68.google.com with SMTP id c13-v6so5588310wrt.1 for ; Thu, 09 Aug 2018 08:48:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=whKrY2RHN+Zh7l3MJ4DRN5Viqc4F/HGnmCz485m88Rw=; b=lr7gaRpCSbWEB6qbQ62cg7ODDxB8iGKb3Gd0kguAN5Vtb4Nk6yY+YM+el8H4oxzCwb eSEswXdzCeT4K/k4uBk88tNOrS1Tb+4n7Cv5z/DRi/lk2ItdJae8H7iFFffEPDrzk4D4 NnmUXuYWEHiIVLCTFrQv6mq8+gtHad0pLni3D0ho6/n+rDuCpxmxcrvR0iOivIs1yp2k Gy4yWVJcu2JPAViOYhXNhSAYKKO2roZBUKpwke26QYRUMrtde/sq9CefTPFbPUlTi0eI GjBZ0QthTX0vqxwlUsAd+hty4cUkLkWpB+SQk3Oiaj5KHQ3/gzr9d0dWGnzytS4OqO5N Aeow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=whKrY2RHN+Zh7l3MJ4DRN5Viqc4F/HGnmCz485m88Rw=; b=ph9+c6J/yds59NfwIl/QxxkuzxQas5SDfVqdu3QCv2AgnraWTUgv4ZK/HF1z1Q484B y4J97X7hxBeh+XZRr9NYVlTtOAZZUbTEJMGEbF9bbyo7RDL8fieEYaIf8/NdVX8Mba7T 8ZNMhYSXvcb9XqMMEzjP4+Zq9NO64KVLD3t5BU/G0m0Ete3wOgYgGYyGBfiJgoJA0Fa2 5ivkUAFwmkz8EuZFwNYKnmXeUIRVizhFyRa+xyht81iUAQJkQYahwBiGB05/LCQmAO/d 8johGD81MCI9QqK0xX9CbgYENLoSSW9E3FOfclG9FNC6j2/0j52JgukqitC6CveiRQyG AkpA== X-Gm-Message-State: AOUpUlGp/OMUNa+qf+xjeoLMHFj60XuE+uVQuRbhVWw6e/sIyUGyIp8h RKeYvMkkZt4AUQY4T42uu4I1L5/X+ANZDv1cMTiA75PtfbY= X-Received: by 2002:adf:bb08:: with SMTP id r8-v6mr1739542wrg.244.1533829685742; Thu, 09 Aug 2018 08:48:05 -0700 (PDT) MIME-Version: 1.0 References: <20180806233229.6454-1-isasi@google.com> <20180807222251.GQ19650@michaelspb> <20180808232502.GX19650@michaelspb> In-Reply-To: From: Sasi Inguva Date: Thu, 9 Aug 2018 08:47:53 -0700 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [PATCH] lavf/mov.c: Set start_time for audio too (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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Pls find attached, the corrected patch. On Wed, Aug 8, 2018 at 5:24 PM Sasi Inguva wrote: > Ok. i'll correct the commit message. > > On Wed, Aug 8, 2018 at 4:25 PM Michael Niedermayer > wrote: > >> On Wed, Aug 08, 2018 at 12:20:34PM -0700, Sasi Inguva wrote: >> > i intended it only for audio, but i don't see any harm if it gets >> applied >> > to subtitle tracks also . >> >> if you want subs incldued then the commit message is wrong at least >> if you dont want subs incldued the change is wrong >> >> >> [...] >> -- >> Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB >> >> If you drop bombs on a foreign country and kill a hundred thousand >> innocent people, expect your government to call the consequence >> "unprovoked inhuman terrorist attacks" and use it to justify dropping >> more bombs and killing more people. The technology changed, the idea is >> old. >> _______________________________________________ >> ffmpeg-devel mailing list >> ffmpeg-devel@ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >> > From a0da82579a1c9ebb81bd029750fa718fa5f1c152 Mon Sep 17 00:00:00 2001 From: Sasi Inguva Date: Mon, 6 Aug 2018 16:28:50 -0700 Subject: [PATCH] lavf/mov.c: Set start_time for all streams (in case of edit lists). 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] -- 2.18.0.597.ga71716f1ad-goog