From patchwork Mon Aug 6 23:32:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 9923 Delivered-To: ffmpegpatchwork@gmail.com Received: by 2002:a02:104:0:0:0:0:0 with SMTP id c4-v6csp3834482jad; Mon, 6 Aug 2018 16:39:30 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwkLr8SO4IgZMUdNGsa1C889DKe+OZj4yp1QCruA3e+NhtmU1kqZT9mfEOnCXQt1zzqKfRh X-Received: by 2002:a1c:d98a:: with SMTP id q132-v6mr93555wmg.78.1533598769934; Mon, 06 Aug 2018 16:39:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533598769; cv=none; d=google.com; s=arc-20160816; b=NJrTImwAJt27sIhnAx0G3rqXvWo9hRfG4ujblHUxp1SUzZbExM1fmHrPG73yr1AAMh VFoR65MLsWJq4pF3vT7Ik6zzrcLhkqZOmEGw7zJRciKrTcIzOHbIU0eZC5ccxwnmRFj0 /zZ+a93GHrapUrhZkYVsXD0Dsp2zQeCoy3J/jYHnMqj24SPraXZhHBLGR6HmcBHnDcRy mk3nF6EZBoS8Yw8Cfe5+1bFPg4j8lEF4Acoqa1SEzIfqwVjTkfKPZWsA6buzGNq3yPoJ FpjHGRG2hJm/mhCwv48ZF9aHSiTXMRye3a1Mgd9JE8J2FA5wMsHpmge3fxVeIRN0nHAC Bk/A== 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:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=NxONjH0fQoTa78Y4uwLpzX6nz1lR+KYeAqkB4NGsSYY=; b=MbDcUGDgZQCKn3YjeeQZ9XAY+SGmadgnxeKNxj5PXh+ajlkklgY6xoL1NHick6CIEs fGZsitgATZaiBVe7/HhgQDBmOZXgcIXUkRwD2E/Lie1IvTa/E9LZNvTBySa9/9JDorLz mLHgnCTHAikjM+6fhON1Jzf+Nid5YgOIyEpMv20NghHT1U8ujrzv2OyPm2TUt5XCzLVZ eTS90kJvvLlz3s8mT/ovZyvUJVIzWeK27hM6gskDfcMa3Q12xPL7hudkfhRYWJbXpo0p PDdfPNmHPbLMmIvDQ30cmbWqM6FOO/WTrPEELJ6g5XdlrciXjiI25YFuMJkUKWemfJCv 24gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=qK2vFzDP; 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 a63-v6si79088wmh.41.2018.08.06.16.39.29; Mon, 06 Aug 2018 16:39:29 -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=qK2vFzDP; 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 0E53A689253; Tue, 7 Aug 2018 02:39:08 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A7421689253 for ; Tue, 7 Aug 2018 02:39:01 +0300 (EEST) Received: by mail-pf1-f178.google.com with SMTP id k19-v6so7601413pfi.1 for ; Mon, 06 Aug 2018 16:39:22 -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:mime-version :content-transfer-encoding; bh=WGXg8uWLO8mEcop2Deu14KP2TEpZzcCOSzwfxFxN2jY=; b=qK2vFzDPD+MAqwrbuAkYquoeQgN9LzQVSUjNfWFmXYuxvLh64Mkuw1Jx4JKtil5VrC d94yZXs7vV5jfggqfPo3Ha9JAE5B3WTRmQRCCL7hzsRMHS+Fh8F8i24TTxht1bdoOWgd Po5x2/JPcERZOdAl329UDI1u797P7GozQR+e68Yl7Mqot0/HAnzoWRe0jHYreUwa2IlY xyhPmH4X4Ijbb4MYahBYb6AODBcq9XvhBO8cYZerbrbgd1XOcEMU0zEzy9csg5iqScMi BoOaEbs7ADTQvc/eE56C49cGd6+FL3HtKTYeJWMfg8KOmx1Ue5O4e97NP5PWIM24VRbu PeLw== 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:mime-version :content-transfer-encoding; bh=WGXg8uWLO8mEcop2Deu14KP2TEpZzcCOSzwfxFxN2jY=; b=jljt13i7IwHxJxh+wgI8nLFuUp3aVVgFE7cLjRWhPik2P8OUQurztCVTOxKD2vlwDC xHdCvE99tGay4KjWFh96w82nWw4sUKgH2JStAac874Hg1VHS0e1bqIuk6S5iwb2VCayG Vg7uMxarTJG1MWEYU+damnblYh4KPMw0I+GDKFTM3Q53ldAWH0kXJ/ne/5IeJC1ONz0H UIP/YVjlkJ4ULkP0/Z0PQBmrYIYgGVqbZnwQ5RtIK0DXGAuRrgeoTPl2az8m558wkGiB epb+yhumtWc5eLu2sUBhzrV74fTngT4FnmE6b0tdNuvNgzdCO3duShrAPxMsYe9Sy3PB WLuQ== X-Gm-Message-State: AOUpUlGqdRJ3L8Txdy0gZg/5jSKAVH3WpEmlqqnILAxK/GhoeK0qe9Fg OjTqPGLkQxpFFM8XYD+NWzwpRU2/vY8= X-Received: by 2002:a62:63c2:: with SMTP id x185-v6mr12506257pfb.13.1533598394938; Mon, 06 Aug 2018 16:33:14 -0700 (PDT) Received: from isasi.mtv.corp.google.com ([2620:0:1000:4011:ff32:fe46:f02a:cd4c]) by smtp.gmail.com with ESMTPSA id c66-v6sm11833682pfc.138.2018.08.06.16.33.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Aug 2018 16:33:13 -0700 (PDT) From: isasi-at-google.com@ffmpeg.org To: ffmpeg-devel@ffmpeg.org Date: Mon, 6 Aug 2018 16:32:29 -0700 Message-Id: <20180806233229.6454-1-isasi@google.com> X-Mailer: git-send-email 2.18.0.597.ga71716f1ad-goog MIME-Version: 1.0 Subject: [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 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]