From patchwork Wed Oct 18 23:00:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasi Inguva X-Patchwork-Id: 5622 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.161.90 with SMTP id m26csp1916813jah; Wed, 18 Oct 2017 16:09:09 -0700 (PDT) X-Received: by 10.223.158.208 with SMTP id b16mr7351127wrf.99.1508368149351; Wed, 18 Oct 2017 16:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1508368149; cv=none; d=google.com; s=arc-20160816; b=Hm2VY1C4M+zU3SEZm33+CYOP9rD9sgpbaIIpFY1JZcZcvHqofJt3rneJbNGb5Q9ATe 46lijvupQLuq7zKbIPkblov+464AEP69Lmw2zk78AvkRqXvStOB1nOzmY3ZVgLxrCfSn fSVrUR9BIaVQN9nTs4G9ddmx/Wov3XZuFzckKkvgQBkZJ5/Z7lSbZQ7ZgoQTkt46NQ36 zmmtuYU8NcEzv0Vtb+pec+ZU/jXLzLQJzY2eh/Zc4C5pRNRkqdufPuOVbK7lPrWAgiE7 G7IdblAfh9Yrzaz3w2LcKf3yFCMphYFrhLRdlGySq6Ph0f0uPtGwsoVYy/hUsFVm/8fa kjLQ== 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:to:message-id:date:from:references :in-reply-to:mime-version:dkim-signature:delivered-to :arc-authentication-results; bh=gqDL2dN7XuP/y8ywVVlYmFoQdBa8dDCbhTbRO/sFBUc=; b=vz35crg8NmnX7z/eOLghhrgdBfznmU1VyVhnAX+EclYK+KQBA0nxGc899ppl4af+0o cqiq9fUwMsaLEqnrC+Nu8vyfkyaRSIotKjzjdvkF8Lex6QFaCV7c4dX7lgR+t0vUHbOf nuE06jA5d9CymeuZpPe88frl2BtwSjepLSUuEIJ2ihttj1b13LG9nTcSMEEugaEIVP2i Yx7s54qd+LXv84PBRdQQvQvp4y7bvOYx426l24kRRtCOkAVKvOcM5r5eh8znP2BY/VLO zIQPyVCd1GWZiJ3vrA9VjA4ll+rt+dbCGfbR8oKtJhKkZ26o+y1s6pYJ6JPEudOpMrXy 3Bug== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@google.com header.s=20161025 header.b=PLacOoMz; 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 t75si32920wmd.201.2017.10.18.16.09.09; Wed, 18 Oct 2017 16:09:09 -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=PLacOoMz; 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 ADB55689FB1; Thu, 19 Oct 2017 02:09:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ua0-f181.google.com (mail-ua0-f181.google.com [209.85.217.181]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1AADC6899A8 for ; Thu, 19 Oct 2017 02:08:57 +0300 (EEST) Received: by mail-ua0-f181.google.com with SMTP id b11so4752451uae.12 for ; Wed, 18 Oct 2017 16:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=Gzn/91FpiIHKCPPiyXKxgjBJ552ipxH7BCgDp2UcGQs=; b=PLacOoMzWbU7QjpESHLZ8Zdv7u+XC9fi9LvVSO+pVRn/tOdnljnd3B0vlqzEFB3Vrk rC2yEnkwm7X5QNPd8itrthJcVJKhNApMKWjFeiwR2aNX8FvMmEaHcOcIc52xGi735JdZ ch4jic8DYuTCFqrLUhgdwhKxTgPsm99+pGMxp7+UzPP7JU0aBISdcunHxD5EyNRyaIpt w8HrAzDDk00DlKnG55xUpaSBSnc6kLqR9L0IfvRoRF0OkGzaSLekiqUnd6o6mcuXXxBu LvcYKvGETCohw1PojU/7/0dofshKayvfpjpLm/UJJUq8eIF3emrPpy5xkhMT/ayWDRPU 0szA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=Gzn/91FpiIHKCPPiyXKxgjBJ552ipxH7BCgDp2UcGQs=; b=iO4YkKZkJTyye4NVd2HTHKte/dpzdFI2Z9e/FEuSr/fbkLb64CUXXv3I2dEB6p1b4w auLHGQvsFOGdKx/yUZvMgDO6XEtpM12phsi3O1xWfqziy6B5i1KepBYYVo5UdCKCKCwP l95sXwbrrTlxWB688BuEWbA6I7xWRrfrV+mwzTrIQEn1Th6vjA1tFzw/l9MlShA4HzAX g8sYYX/ch5cQvdEh/hhqGRPEjdW8DuOzkU0aJMBZVmPkLSfv2HHSbwK+nNH/3ViGPUSR CcUPRZpzeV2kw5G5rE1rIEq0Omm7yZf+4Z91mhVepyN8P+KsDz1czV3MdmKf5VpLwME5 E+SQ== X-Gm-Message-State: AMCzsaWl4fXyWWA3Wcnjp1oHOLOIpQektyGLBlpBkDxEgDImPBlUtXOo DPKg/jIH993/Ow+aSyd1UdLXupdd1bSD57OBrc7QtQ== X-Google-Smtp-Source: ABhQp+QH3LJBhv0xIhNNNdiII3wrStqQ7C0nQb2vc3sAMfMspM/Ua8+qNbdetZ1KXCDC+IvLgYkHKCfm6jS+tAGoSBg= X-Received: by 10.159.63.15 with SMTP id h15mr14898380uaj.156.1508367657179; Wed, 18 Oct 2017 16:00:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.47.23 with HTTP; Wed, 18 Oct 2017 16:00:56 -0700 (PDT) In-Reply-To: References: From: Sasi Inguva Date: Wed, 18 Oct 2017 16:00:56 -0700 Message-ID: To: Dale Curtis X-Content-Filtered-By: Mailman/MimeDel 2.1.20 Subject: Re: [FFmpeg-devel] [mov] When both edit list and start padding present, take maximum. 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: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Thanks for the patch. The bug is because mov_fix_index updates skip_samples correctly, but not start_pad. Can you instead of taking the max, just update the mov_fix_index function so that start_pad = skip_samples always. Something like this } } } @@ -3324,6 +3323,8 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) // Update av stream length st->duration = edit_list_dts_entry_end - start_dts; + msc->start_pad = st->skip_samples; + // Free the old index and the old CTTS structures av_free(e_old); av_free(ctts_data_old); Thanks. On Mon, Oct 16, 2017 at 2:25 PM, Dale Curtis wrote: > More details on the issue which uncovered this can be seen here > https://bugs.chromium.org/p/chromium/issues/detail?id=775042#c13 > > - dale > > On Mon, Oct 16, 2017 at 2:22 PM, Dale Curtis > wrote: > >> Previously the start padding was used to blindly overwrite any skip >> samples which may have come from an edit list. Instead take the maximum of >> the two. >> >> A new fate test is added, fate-mov-440hz-10ms, to ensure this is handled >> correctly. >> >> The sample can be downloaded and added to the fate-suite from >> >> https://cs.chromium.org/chromium/src/third_party/WebKit/ >> LayoutTests/webaudio/resources/media/440hz-10ms.m4a >> >> - dale >> > > diff --git a/libavformat/mov.c b/libavformat/mov.c index 899690d920..355e1d09fd 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -3249,7 +3249,6 @@ static void mov_fix_index(MOVContext *mov, AVStream *st) // Increment skip_samples for the first non-zero audio edit list if (first_non_zero_audio_edit > 0 && st->codecpar->codec_id != AV_CODEC_ID_VORBIS) { st->skip_samples += frame_duration; - msc->start_pad = st->skip_samples;