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 8A6FE4B403 for ; Sat, 6 Jul 2024 11:11:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 1EF2468DBC9; Sat, 6 Jul 2024 14:11:04 +0300 (EEST) Received: from mail-ej1-f53.google.com (mail-ej1-f53.google.com [209.85.218.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F47D68D7A0 for ; Sat, 6 Jul 2024 14:10:58 +0300 (EEST) Received: by mail-ej1-f53.google.com with SMTP id a640c23a62f3a-a77c4309fc8so224512066b.3 for ; Sat, 06 Jul 2024 04:10:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720264257; x=1720869057; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=UdCLTnqLNgMynHVu6cDe1+qqUxZ9nR4E9FzsckNyOZU=; b=JnH6a5qApKW/Hghns+ukZZ04FRdwdtCEUebka1fkdacd+njHYHeRwZ0U+Gk/sxHNfS 97ed1IH6oqKvnNFXouawjAg1GeWjhBr68nD3JbxsDPncWdVuPiE8RXdeFiytGGfhIdkt L3QrygQQJ+uZpDRsb8eZKDjz05MffQQsHY1vLx66PeS3uzRXdN5mESoIxRJ/GtlYj2g8 6qk0ywoy4w1FPtgUtS1Qio+7WcGjIcI8cVGR4Op5L/5xdxNwithgZiuo2LK8dXaztgoR Doz8wgHaLRQOYloHiLSzAbj8b9eqfOsaPfDe9O2QtOqnL5APA6TGWMFpuQWuLNNoiTiV 8y6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720264257; x=1720869057; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=UdCLTnqLNgMynHVu6cDe1+qqUxZ9nR4E9FzsckNyOZU=; b=PVh0XwcvXvUBCTJlhptkvIa6EGTg3LPW5ICmELXfMAlqU9RASKFxLqUSIITDz3rUtX kO6KI7h+XX1hnFFZRCkyMUvYWCIAOBEwBn8a24z6YA7LCzS5Bj9BTq8HZyrsEEIrpDXs CT9joGK/KS3FWOlkW6r/CPp/ToyShFgaF3JC5Pw9NZVD93zNNtHgS/+hRL/IVbcRnz8X NPtOmXCkM/9Ndd5EtDHchaeV5lLBUxN8HsOCpgA2bUnkCeyNKVXyMVPd/jO09OieXFWK qOa4Jg8VyifKaAPVlZqI44zkyAEdqybpI+CZLx8SQVRrdST6LRjCvLBoCgkjCFg7LKFy 3M+g== X-Gm-Message-State: AOJu0YwU+C3BITMWcqCLqUAEt7AT+eHbfCo3NhhF6Y6Rsc0DmLIax1S+ hTJbdq0OLoK4YevGRMip7jdvuGdRPoSkiGD97G6EJQisckmW6XOnyXHaN7uORpc= X-Google-Smtp-Source: AGHT+IH3K4yfVpikCBc/yL/xgD438X6yopEZJORFFuJgApaU1dE6kc43qlFEAmnu4WxwkIaD6w4M1g== X-Received: by 2002:a17:906:34d3:b0:a72:554d:82af with SMTP id a640c23a62f3a-a77ba46bb9emr473650166b.20.1720264256601; Sat, 06 Jul 2024 04:10:56 -0700 (PDT) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a77dcac1344sm86041766b.202.2024.07.06.04.10.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jul 2024 04:10:56 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 0270FBFCE8; Sat, 6 Jul 2024 13:10:54 +0200 (CEST) Date: Sat, 6 Jul 2024 13:10:54 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Marth64 References: <20240702054139.1308221-1-marth64@proxyid.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240702054139.1308221-1-marth64@proxyid.net> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH] avformat/dvdvideodec: Don't add chapter markers for empty/dummy PTTs 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 Cc: Marth64 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: On date Tuesday 2024-07-02 00:41:39 -0500, Marth64 wrote: > Some discs (usually same ones with padding cells), also have empty > padding PTTs / chapters to accompany them. This results, for example, > in an extra chapter marker that starts and ends at 0 (no duration). > > Don't add these empty chapter markers. > > Signed-off-by: Marth64 > --- > libavformat/dvdvideodec.c | 16 +++++++++++----- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c > index f5b7dd33e5..0bf1a82ef9 100644 > --- a/libavformat/dvdvideodec.c > +++ b/libavformat/dvdvideodec.c > @@ -874,6 +874,9 @@ static int dvdvideo_chapters_setup_simple(AVFormatContext *s) > for (int i = chapter_start - 1; i < chapter_end; i++) { > uint64_t time_effective = c->play_state.pgc_pg_times_est[i] - c->play_state.nav_pts; > > + if (time_effective - time_prev == 0) > + continue; > + > if (chapter_start != chapter_end && > !avpriv_new_chapter(s, i, DVDVIDEO_TIME_BASE_Q, time_prev, time_effective, NULL)) { > > @@ -934,13 +937,16 @@ static int dvdvideo_chapters_setup_preindex(AVFormatContext *s) > continue; > } > > - if (!avpriv_new_chapter(s, nb_chapters, DVDVIDEO_TIME_BASE_Q, cur_chapter_offset, > - cur_chapter_offset + cur_chapter_duration, NULL)) { > - ret = AVERROR(ENOMEM); > - goto end_close; > + if (cur_chapter_duration > 0) { > + if (!avpriv_new_chapter(s, nb_chapters, DVDVIDEO_TIME_BASE_Q, cur_chapter_offset, > + cur_chapter_offset + cur_chapter_duration, NULL)) { > + ret = AVERROR(ENOMEM); > + goto end_close; > + } > + > + nb_chapters++; > } LGTM. _______________________________________________ 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".