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 E87C44B40A for ; Sat, 6 Jul 2024 11:19:03 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4660468DBE4; Sat, 6 Jul 2024 14:19:01 +0300 (EEST) Received: from mail-ej1-f41.google.com (mail-ej1-f41.google.com [209.85.218.41]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id B7A7E68D650 for ; Sat, 6 Jul 2024 14:18:54 +0300 (EEST) Received: by mail-ej1-f41.google.com with SMTP id a640c23a62f3a-a77c9d3e593so172100466b.0 for ; Sat, 06 Jul 2024 04:18:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720264734; x=1720869534; 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=oII0SlaWyyM+l9RMjwzNuW879yYJNLYW9lvzKxR4LcM=; b=iRDnkNhMETJZpXNOymeTnhVfa1r9M/GKR/pq1H8kVzsvdGHN6UjCrSBkUqEHKzCfdT nzeEb+lTeO7epXqcuRD61QiiHlTVqN1MlewbBjlo6yqIlk6QCC7fIYxtw6JgQ7f3t0yG Y+xVOu4Vj/yXKE09GKHgSEm6rFktpOswPVLG/SLKgxD50y7vE3EZ7YiaV0aIyjjbGiAG nvct4oxJxM6xtVK0pD7g8k8ppOBucX2sxtXJbKGP7TabhkYG7iCS6MTKoxY80YjMH22H fL9oDPhpF1a3QkM4ixUijikGBItjQtxdEdGdJrqwkLqB2i+qGdWSeHxxdYXbE4c8oql6 eieg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720264734; x=1720869534; 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=oII0SlaWyyM+l9RMjwzNuW879yYJNLYW9lvzKxR4LcM=; b=r2oSlF6sjxtzrxoC0/kJuTT/FbYYu4uTUkIyKR6mIxe6PVv6fT8So2ITDRbAeIR9Wu pYONdYo+B6bLSU5HMtWPl2DB2ZBO/o7Z7Z98CIjUMIRuCvWFFgePnioitvonweC8Fee9 GOR2oWU6ictRz/Sfpf+PeO47lVbzKToACxMGCixcy6AD/wDfJfHdwgZQf5q/HYKTXuI3 1zZYfqJAtlykJ942ZN5NQN9H+JJC1MEz8cSarIdd8fGus/82u2g7K3d/GuVmyXZR1b3Z 9t45kFAZXhhwj7U+eLo/87Gufa95GIm0BRT8E7fi9tSkmyX7U9HtcjwonSKiLCfMjVBT Q2UA== X-Gm-Message-State: AOJu0Yz2/IFzxb+7mQhIxqV1ipQcOpy7EdzVsh1ue8uMO5GQZOoLrH0i H6rSII0XokAZwArNwODi58/GIi3+fpdtN3JgFSEis5L+XNMWGEUYd78u7g5W7Eo= X-Google-Smtp-Source: AGHT+IE4yEZ4bWfQMLsRXQItX0yPLuXI2Ix2s2+dNBGhcvO/Y3FD8Bwy2hsba111e/LPkGbQR9rL5g== X-Received: by 2002:a17:906:6bc6:b0:a77:db36:1cc6 with SMTP id a640c23a62f3a-a77db361dcamr170331266b.68.1720264733369; Sat, 06 Jul 2024 04:18:53 -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-a77be903eb6sm199981566b.23.2024.07.06.04.18.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Jul 2024 04:18:52 -0700 (PDT) Received: by mariano (Postfix, from userid 1000) id 8D110BFCE8; Sat, 6 Jul 2024 13:18:51 +0200 (CEST) Date: Sat, 6 Jul 2024 13:18:51 +0200 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Marth64 References: <20240702064131.1310942-1-marth64@proxyid.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240702064131.1310942-1-marth64@proxyid.net> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH v4] avformat/dvdvideodec: Fix incorrect padding cell trim logic 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 01:41:31 -0500, Marth64 wrote: > When -trim option is used (by default), padding cells > at the beginning of the title are supposed to be ignored. > The current implementation does the ignoring after we > have locked on to the PGC navigation event stream, > but does not set the PGC/PG state properly. > > This causes false positives and errors on some discs > due to a search for a program stream cell that > never succeeds. User would have to know to disable > the -trim option to work around the issue. > > Simplify the logic and move it to the NAV packet > event handling, in turn implementing the behaviour > correctly and fixing the trim function for impacted discs. > > Signed-off-by: Marth64 > --- > libavformat/dvdvideodec.c | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > > diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c > index e7132725b7..c694e8d00f 100644 > --- a/libavformat/dvdvideodec.c > +++ b/libavformat/dvdvideodec.c > @@ -624,7 +624,6 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState > dvdnav_vts_change_event_t *e_vts; > dvdnav_cell_change_event_t *e_cell; > int cur_title, cur_pgcn, cur_pgn, cur_angle, cur_title_unused, cur_ptt, cur_nb_angles; > - int is_cell_promising = 0; > pci_t *e_pci; > dsi_t *e_dsi; > > @@ -706,23 +705,17 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState > continue; > > e_cell = (dvdnav_cell_change_event_t *) nav_buf; > - is_cell_promising = !c->opt_trim || dvdvideo_is_cell_promising(s, state->pgc, e_cell->cellN); > > - av_log(s, AV_LOG_DEBUG, "new cell: prev=%d new=%d promising=%d\n", > - state->celln, e_cell->cellN, is_cell_promising); > + av_log(s, AV_LOG_DEBUG, "new cell: prev=%d new=%d\n", state->celln, e_cell->cellN); > > if (!state->in_ps && !state->in_pgc) { > if (cur_title == c->opt_title && > (c->opt_pgc || cur_ptt == c->opt_chapter_start) && > cur_pgcn == state->pgcn && > - cur_pgn == state->entry_pgn && > - is_cell_promising) { > + cur_pgn == state->entry_pgn) { > > state->in_pgc = 1; > } > - > - if (c->opt_trim && !is_cell_promising) > - av_log(s, AV_LOG_INFO, "Skipping padding cell #%d\n", e_cell->cellN); > } else if (state->celln >= e_cell->cellN || state->pgn > cur_pgn) { > return AVERROR_EOF; > } > @@ -766,6 +759,13 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState > e_pci->pci_gi.nv_pck_lbn, state->vobu_duration, state->nav_pts); > > if (!state->in_ps) { > + if (c->opt_trim && !dvdvideo_is_cell_promising(s, state->pgc, state->celln)) { > + av_log(s, AV_LOG_INFO, "Skipping padding cell #%d\n", state->celln); nit++: possibly add some more information to aid debugging, such as "Trimming enabled, skipping padding cell for non promising cell ..." [...] Looks good to me anyway, thanks. _______________________________________________ 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".