From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id D855B43E1D for ; Mon, 15 Aug 2022 23:15:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 394CD68B8AC; Tue, 16 Aug 2022 02:15:07 +0300 (EEST) Received: from mail-vk1-f173.google.com (mail-vk1-f173.google.com [209.85.221.173]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1E2C968AE45 for ; Tue, 16 Aug 2022 02:15:01 +0300 (EEST) Received: by mail-vk1-f173.google.com with SMTP id bq26so4397283vkb.8 for ; Mon, 15 Aug 2022 16:15:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc; bh=w+Vh1Sn4q1RYgah+yPkIXjDO6IsDzhp1loRykV/nM5U=; b=UJldGjRdE7P+aXjbtjYGCEg949J1OUvygFQw2EEz3z5gZE/JQ+Fo/UR4rZryxLk5XH Jo3Pw0bGSdvc8uGasHbe+70a3EP0qkuWGUBgNLnGdE/B14/G3G0W4RRt4yYllgqsiaee fXveFMKNFLlbs7YXdC0KDd4FT3E6NnksChTTcL4moF7vMmJpxxH1yY/+U/VsAbtSrVpI kK6kpOXjPw4q8izKb+/Ay7T5iSM7WUp937pPL+OqFNl54jJHtY2QeyVTg/laeNRrqTB/ v6CKswbLn+Tv/kIderpamgZA7b4aosnbAhso8UodvPVMr4TSc4xYmjoXjeXXcme9IOLV x/bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc; bh=w+Vh1Sn4q1RYgah+yPkIXjDO6IsDzhp1loRykV/nM5U=; b=sbbzSDq31UJTE7IS3HDlR2OVo85+8ssGtbscVXYaFqZz7U55rFl67KzP/6dtXHrKxN nhu1Afizm/aqsgtlbytPjcnnsHIFWhFwU8Lk9tcsRMzCAryr1vYaAE1SD/LsAlBddv8q 7yMJK2t2NI+SzuITmfoMLwUrvUmZLyzPppCOsoRTwhGv6z/RPLMMcfuXuq6tutokF4Cz THEjGx9m6hVukZq5Fw+xlh1Jdx7YJ4VZahBOMWXz+Nw2jm0OfSWLepi+aTPhPT1bQzwv qYQxaXLum2dl/QMsYU0slQUXHrOcsta3JQOj8b3OerB8ZuZlwq770r0Mx14HREQ6sct1 Gegw== X-Gm-Message-State: ACgBeo19lXHN1sXWbMXH1yN7K6xxqbaD0RX9fwbXrQlmejkZR+/3uWS+ CkR+xAzrvWNA7Xuya4tg/F9/b9tdv3o= X-Google-Smtp-Source: AA6agR7luIwxfBnGs3n3JVUR8w7F16ADk1OTNSLnYKyrAPU32aQTnloHsYS3nJ8wdLhAaz5PlXRtKQ== X-Received: by 2002:a1f:6e01:0:b0:377:93a7:e5f1 with SMTP id j1-20020a1f6e01000000b0037793a7e5f1mr7512493vkc.12.1660605298215; Mon, 15 Aug 2022 16:14:58 -0700 (PDT) Received: from localhost.localdomain ([191.97.187.183]) by smtp.gmail.com with ESMTPSA id i25-20020ab00d99000000b003842250a024sm5836953uak.10.2022.08.15.16.14.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Aug 2022 16:14:57 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Mon, 15 Aug 2022 20:14:42 -0300 Message-Id: <20220815231442.1976-1-jamrial@gmail.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avformat/mov: don't read duration from mvhd atom X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This duration is equal to the longest duration in all track's tkhd atoms, which may be comprised of the sum of all edit lists in each track. Empty edit lists in tracks represent start_time, and the actual media duration is stored in the mdhd atom. This change lets the generic demux code derive the longest track duration taken from mdhd atoms, so the correct duration and start_time combination will be reported. Should fix ticket #9775. Signed-off-by: James Almer --- libavformat/mov.c | 4 ---- tests/ref/fate/gaplessenc-itunes-to-ipod-aac | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 6ee6ed0950..fee9c39f39 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1516,10 +1516,6 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_log(c->fc, AV_LOG_TRACE, "time scale = %i\n", c->time_scale); c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */ - // set the AVFormatContext duration because the duration of individual tracks - // may be inaccurate - if (!c->trex_data) - c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale); avio_rb32(pb); /* preferred scale */ avio_rb16(pb); /* preferred volume */ diff --git a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac index f967ac05bc..1f89e9af85 100644 --- a/tests/ref/fate/gaplessenc-itunes-to-ipod-aac +++ b/tests/ref/fate/gaplessenc-itunes-to-ipod-aac @@ -5,7 +5,7 @@ duration_ts=103326 [/STREAM] [FORMAT] start_time=0.000000 -duration=2.344000 +duration=2.342993 [/FORMAT] packet|pts=-1024|dts=-1024|duration=1024|flags=KD|side_data| -- 2.37.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".