From patchwork Mon Sep 23 05:19:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51717 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2243773vqb; Sun, 22 Sep 2024 22:20:10 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCULJKW1zT8TqEuXhvWzFDBhPbQcW66xnOxl2Kil8HqGMhaJNEy9caBrgoF5EhLULq/zJ6cvCgaNVZbTvHIvKGAf@gmail.com X-Google-Smtp-Source: AGHT+IFOxqBXCiROoRFHMpP+M7sw4VI51DwJIQRKoVXxT9jtXaqFCg7EvRFx79otSEqgeUpLWeOt X-Received: by 2002:a05:6512:159b:b0:533:44e8:5565 with SMTP id 2adb3069b0e04-536ac32e1eamr5307787e87.46.1727068810328; Sun, 22 Sep 2024 22:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727068810; cv=none; d=google.com; s=arc-20240605; b=arHQiiuhGBWZoG7lsmPYtVkK2HoKuL5YJ3KiKX1C+PhbuFYyYsJOhd7Zw/kPINhuWg xJSArkHzoz/58gNtWoi6PBy8zt1gasxF8DLyJKB3U8PF6a3VjttydChKdm8pWo841mlr 8E2fg7N12syRemE/7b237qNWhAhwDNSMSgPVrrxRMSOUnSzlAUYRJ3OMrChFxqvLoVmr p1H9T++ixvLBILDWirrnBfjH2Fhu1VmPUsRHW005Fti+tCFoiqHeLKLGOt4oHvCrKavw m+KLixNs7b8cXk4wPUgADPXm7TdAKGI99wTVkwv4ybu0+VZiqrmnvyQKrHbk76PZ2M88 iAuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=7axDYkXEijTp5JvPkcnDtIgb/UZw4OvJbNUq1Xfo5VA=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=XnOa3Y0CtisQiRMqcxs4HYOHGSEFrD3uaRmDZktdNF9XYCPj2jUj5Jm78WjdXTqyWH ejYKOv9y0sq6qFnG4wu5cqF9q4aslxRFqmsd4H9grRDUTiYHlvdL64F9JYI8jXEQjqcN HJW/T4atflvBlBbkoD40Ios8/Jmoa5XYkWQHaRqTBXvIUpky+A37mfQWJ86Ca3BUYMql OJu5eAjzGdDtadNshVwUd9CpO7SRUYLwXkSptMwzpnxIkTXlR7CMOW0+aW5e6xrPoKIi wNeQEHf6vUpex6Ow+HmHmQJroEaeB3VsWYOHsdAIfq+oTe/hSlQkjIdIZmDSFGiRB+C1 fvgA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=Trr4ySPC; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2adb3069b0e04-536870a0c6dsi6055342e87.418.2024.09.22.22.20.09; Sun, 22 Sep 2024 22:20:10 -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=@proxyid.net header.s=google header.b=Trr4ySPC; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EA8A968DB29; Mon, 23 Sep 2024 08:19:57 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f226.google.com (mail-oi1-f226.google.com [209.85.167.226]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 37DF368D950 for ; Mon, 23 Sep 2024 08:19:49 +0300 (EEST) Received: by mail-oi1-f226.google.com with SMTP id 5614622812f47-3e04b7b3c6dso1958801b6e.2 for ; Sun, 22 Sep 2024 22:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068788; x=1727673588; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=loTLzzW8aDT8NYQFmBdJiZId8L59LMVrNECDWp4YBj4=; b=Trr4ySPCPQcj6EPX1A8rODm9vgFYI3AsUjBxwevk2cJTMT7bnjKPKF5xgWLcnl3GkD 66zXQDK1vhvwKHBy4m7GX6wcEOY+vz/3SP2SvqcwtC5DaBzkGN3MIbZ+7lqUKWL6/drG 3o3Sk/8T9sdaaBlVMf/ovVNtH161R9g7SfkHYNVzpF8PQTzy+hSQ7AXlQ9qCbuEOJTlx hyZdMSK1ZREUqWxgpAnqM0X2KlVQW5Ft9ii8AY3C1x7LWt3mk3T4vM7HRkEJcB2+0ySt aRjZigXGDxJB4tQZO3kfG1PeGjCui4lNr5po/uSJStWIWpuqttcQIZV/pXLtErhQOr6D EomA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068788; x=1727673588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=loTLzzW8aDT8NYQFmBdJiZId8L59LMVrNECDWp4YBj4=; b=i9mJxIC9sja6ZI2sdk6Y8JA9sb5uc4eEnj0SD0g03X+sxPjdx4udf7ilOAnB8C9bmN HHFf3DhPP84X4itkl9Z3qUGfICx+tRsfytGbyIt52azKCAUdZ6/vvJ5scD1RNATx1oGd ln9baVycbsI6KDt5lLyUVxB3U2Viz1tGKYZtzYh8ifS0x60bEwvIZESogioElTZkSclv UYIR4h71Cddr8/FG8Nio48Lodlcym/bhmoNNu5jgCiOnP1seJq6gy5agFVU6ruBkklZ8 rBzorQa6OvHYYeKEJk7f/kPyslEDavTMgMEJ7GQ6ozrC6JRnFJg8owpDRYKsfD7/D13r WGdw== X-Gm-Message-State: AOJu0YwdjPfHgApwzj1dbPE9hYZGV0V8cH7Ijd+djTs+sqD6JU0/9xTR 8HNs99K1cQEDAq7CS0hQKFn68/JVF/RpQNQ3SVAjPp9+psJzsXMqw68ULDtvZveI5t0YhFv/Ruv hwbniG0/Ya14XPYxj6jS/GoF5DIhHtbGmlAx0NnI+ X-Received: by 2002:a05:6808:3388:b0:3e0:80ed:3f9b with SMTP id 5614622812f47-3e27297c501mr5263225b6e.27.1727068787744; Sun, 22 Sep 2024 22:19:47 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:47 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:31 -0500 Message-Id: <20240923051941.54124-2-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 01/11] avformat/dvdvideodec: remove unused headers 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: hzFOZ1Bpe5T8 Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 6bd1dbc17f..4e33d1aba6 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -44,8 +44,6 @@ #include "libavutil/mem.h" #include "libavutil/opt.h" #include "libavutil/samplefmt.h" -#include "libavutil/time.h" -#include "libavutil/timestamp.h" #include "avformat.h" #include "avio_internal.h" From patchwork Mon Sep 23 05:19:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51724 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2245940vqb; Sun, 22 Sep 2024 22:29:24 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWRp3XWCru6gC/f9sCAGts3LmouXKvjR4aThguDbVsRWH/S+oxWk+8NjsYkLC9hFFawYjEAyle0dggLi//fUv0s@gmail.com X-Google-Smtp-Source: AGHT+IFDVJbp+0Rhohe5HaWeG6rxDqb4721f6uS7ng9s0Me2+W2XFsHcz4OmlPl4tbC1qkiAVfCC X-Received: by 2002:a5d:4d50:0:b0:368:633d:f111 with SMTP id ffacd0b85a97d-37a4235a1f8mr6411075f8f.40.1727069364043; Sun, 22 Sep 2024 22:29:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727069364; cv=none; d=google.com; s=arc-20240605; b=VZOvnJdbE3lVnejEuTOSvYzBPWP7UJIFiUGNKw0viUcook568FZYa36M4mSTwAQTqx t5XzEPdCSk2S8EHPqD6OKI+O0E53HaidoFxt6fOjVmCGASh1EoFrBMcQbfFRVewKXkjM jQp2nf1ll39qOVaha24rSsLh97Uurw2IAIqKwXL4yqeZ/mlx2YO70lJKLbrIHM06A+Jd 6mt5YUmhMv/H+/zQIIu+tqsAX8Ja1oj2xxFsM3vIcCNFqjBnzqC+MLTcbp+odvAoqYUX t+RChh4k2bEaC5CcYWO1AHZ1vMGmivgfIoGq9f24eJJlUFxUYKKu4M48hkNHAzh+6AGx FsYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=NkNlBZEJAzzzIBG9HOkVRyxh28mBEThcAJE96qHcMKM=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=b6ElUqbrjx6sSvgaNcdOj5Du9WjGslV7713Rhc0YQ+AnDKwZMHereZMGqBY1YXbbGb IqC0JtaXfiGJqQYupYebao9dMBBqCRbaZJnxIPwQZNbnNBmT8uNCyBtL+SsSV9X8yhi7 0R3frEoBnolHUuLMj4LWq0ATbqVsk2N8oPHO+WKQIqS0eEFYLPYX9ojFWmQr430H7Bzz Em59algD8A4ktmv1hvee9yj3IJsvfTqGFdNhqRM1OQEAevxDmOzdPRgtlqNosIEmKokg kYG9BGhz5KBw8IGIim6w989KF5EkIX9cioUg7BLkJcb3Fl66WdbDhqTfE5yl3QL4E1Kp olGQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=Xm3zxVEM; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c42bcb922esi12694003a12.664.2024.09.22.22.29.23; Sun, 22 Sep 2024 22:29:24 -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=@proxyid.net header.s=google header.b=Xm3zxVEM; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DFFCE68D9D1; Mon, 23 Sep 2024 08:19:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oo1-f99.google.com (mail-oo1-f99.google.com [209.85.161.99]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7EBAF68D942 for ; Mon, 23 Sep 2024 08:19:49 +0300 (EEST) Received: by mail-oo1-f99.google.com with SMTP id 006d021491bc7-5e1b6e8720dso2241002eaf.0 for ; Sun, 22 Sep 2024 22:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068788; x=1727673588; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nkPcsxbA//kCp2fW1fTIGKrPagfodVvP7NzzUzZwM5U=; b=Xm3zxVEMjxsMnSr5KdrhhWHeuZsIu0NWa46zgfzU+/YMMkFPIe6eG6N1ojHMfhBOX9 V78vG/3rx10P4D7XtvEk6p6Eoh+up3MADMGd2A0T+kxbv1Y7s0QXBvew3F4BgrGeP6MI 09DQoM1W9RxR3KEKXIkN7BEKMw9QmdOttP+aOsGhbp5BGSxQrAjblo6nTQZPhFp7g9As Dqre9bAVpXk/9FgLlOrsA8/+ILMKE1jiqH0PQYEPJHoMStDpiP0ln/g5Qr9CbqSNbh1q s+HPmefUfaWZZwQPlnjo7MwYE15SXOBWNnONswDBjXB7EDZC8EuNwdpN7xpiNdxd781K b1jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068788; x=1727673588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nkPcsxbA//kCp2fW1fTIGKrPagfodVvP7NzzUzZwM5U=; b=WtMFDBTexm4I0VZxWCJkztCR0auSkUhBv/d229+zNM6zWL8SQXD1FVnYJMbag84Z24 zDOD49TQ1517rkfj/JTlbJmqnO6YTt2SYf9wF/zcz2RFsqN2mz8khTp0PbstrpoyO0/2 Ezru6HKBWeKk3zmkFoPgxKpQ/fvypRqZuJn6VuZurRzYdMHgrOjkmAkHQH6te3tTQTuc jdpQSMnDJ1WC8rArK4+eKYh2O3583wPMIJwVfXwpzugOuj0bT2A/CuD9jIaLmthvg4nK Iivjec4NwrYEHXqgEkOZY0YFq41YxnM9TfJN9n2J8lHPJMe56D+howWMPWEcLXrjwjLE SQDA== X-Gm-Message-State: AOJu0Yw9+nPl6klcDp9mZZbD3M0GWntLPL9V063S540kIu9dDd/ZEUjC 9Yyh2VvvCBeCfKLforrZmWb7DdZya0kEYwtgrZTPap2GS9pDaICKONwMUrN4ySHpn710/iaLcN8 2v+PPyujIdLkb4hyOvNhV+3e5mgD8Q2QITyLz2KB6 X-Received: by 2002:a05:6820:1c85:b0:5e1:eba9:8fe7 with SMTP id 006d021491bc7-5e58ba7251dmr5041805eaf.3.1727068788108; Sun, 22 Sep 2024 22:19:48 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.47 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:48 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:32 -0500 Message-Id: <20240923051941.54124-3-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 02/11] avformat/dvdvideodec: fix menu PGC number off-by-one in state 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: b2/S5EqBo4l4 Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 4e33d1aba6..da41a9d329 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -344,7 +344,7 @@ static int dvdvideo_menu_open(AVFormatContext *s, DVDVideoPlaybackState *state) } /* make sure the PGC is valid */ - state->pgcn = c->opt_pgc - 1; + state->pgcn = c->opt_pgc; state->pgc = pgci_ut->lu[c->opt_menu_lu - 1].pgcit->pgci_srp[c->opt_pgc - 1].pgc; if (!state->pgc || !state->pgc->program_map || !state->pgc->cell_playback) { av_log(s, AV_LOG_ERROR, "Invalid PGC structure for menu [LU %d, PGC %d]\n", From patchwork Mon Sep 23 05:19:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51718 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2243846vqb; Sun, 22 Sep 2024 22:20:29 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWUTvbb0qS9PhuAUuqrjnUZ6cnSGzJHQd3iLdgPt7TYhoBoYgIepba6ZjPFJD3Io3Jo2UsLvBdHQ26/VyfeV1At@gmail.com X-Google-Smtp-Source: AGHT+IFk723hGpUEpvFF8Vw3sCT7VyYjERLeGcz32ac++uaCrT402D6Mmh3XMhCjO7q0ZmXVqYg9 X-Received: by 2002:a50:cb88:0:b0:5c4:204c:bf1c with SMTP id 4fb4d7f45d1cf-5c464a3b514mr7579137a12.13.1727068829091; Sun, 22 Sep 2024 22:20:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727068829; cv=none; d=google.com; s=arc-20240605; b=O07v0L9keYHQwER86PS35p1xwnsnVoWt2KREbn7GW0eAYpSbqU22HFztr9aZMeZk76 SgMjUBBCaFUfSHbAKOqUt+gOyKwiDJP1hCV8bOxFG+bIi8+d6ns+umspGGQ6KzrI8bn5 9fXQbQD0F+kOdDgTpLpEuVguXfRAhAY24ay38bH8VwsfxVcF0vLsFYZPqSai99P8wOZ4 II/LDquyKuFybmgN2QF/a1DliJkx9CODub9DiCm/XGWe4BylPDO57KigAdYAwL786hAU lG5pHs1Catc/t/X03kJAYbHqmmm8ywF7CNgwK+5z8SgVKNJyA5vws6Wj8JgbbCnIc7vh drKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=2wH857sC6kPKSowg/TLwjZuzmbZdLu9YQIK8ynGMQak=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=NxVC0opW4uapEg4zCxlSN0zKLkPBQUjLt8TXZh5tLdXRJHo9mtTLf1tRi8tc2J0JsI TDq1z5SBlL65OvBfp3t7979JqaZeuhwxfeLh9ualHPkE0zE9dtpifeGDffKc/NsJoW0y i2+zSVkEqt9/3mQH8oeo5R9ZREBLv6cjK1g1b0WGHhbX2IUHYzrUePWHCnf2M0EgJOwh /tVQL7VO+bJfVHLq5pxA8wcWK4bwLzvU30/0g2T2Xpw0D8jji2SJQPF0/F2FI2Z0ApIB orPOO5VKlupZNJQm0zEpdbAVCUr5gFRHiD2hKZPPtX+K3fgTuTf+DJCmlLbY0/wHLOEd VZiQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=hnTQeJU5; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c42bcaba47si13701237a12.516.2024.09.22.22.20.28; Sun, 22 Sep 2024 22:20: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=@proxyid.net header.s=google header.b=hnTQeJU5; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 284CD68DBA3; Mon, 23 Sep 2024 08:20:00 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f225.google.com (mail-oi1-f225.google.com [209.85.167.225]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E81DD68D942 for ; Mon, 23 Sep 2024 08:19:49 +0300 (EEST) Received: by mail-oi1-f225.google.com with SMTP id 5614622812f47-3e034fac53bso1658818b6e.3 for ; Sun, 22 Sep 2024 22:19:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068788; x=1727673588; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0L7byPYYnH0+PsfMNuHrNe2aVuXYoavA1NUwsvOvbKQ=; b=hnTQeJU5lsY5DMJFL+R7vA5ALbdd0WD3JNVIkGPwoICRfXcRsLtYMpGvavBIi71OU1 wtWEjgL9Djg9IAIht4chRFOBCs8dAFeqlhfqWmj9a/FReeF1HtWW8I2axXww+91ycI7H 1JjVuQ/NdDlESOY1RiXXAz8S0kQeB41BABdS3Uk1n/qzwJp2YyvBCpCSJ8Nt+3GR0GHx QOufw8AIreHcGDd6IvAA8aKyHjHcQExZAmZT7MypLxozftFJXK/f+jyMYU7BABwLOgYj Gh4oFx3SGoyu5o6b4blFAKviWg17xpaEShcG3n11zrvie1Z+gI/BjoBCfoARObmoJ0ae 8eqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068788; x=1727673588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0L7byPYYnH0+PsfMNuHrNe2aVuXYoavA1NUwsvOvbKQ=; b=lq6iL/cE0AXUGdZkq+ixK46o+ugpywTGowPw6C2VLFEx3HX6GGHz0zi/uDTTxhPXm1 twRZf1ywfgQ2rx7rAfM7ybpBsFFjAj6QzQ6y0hCvVSajbCAfF1slnE2WBf0IuYPOjKSt vbHkp5IajyGie4i2W7tsuWcUW2VMl/YUbUNKBU/0E/bz0moTFvQ6UP96kTE3BawkY7o1 SUijj8uqmwVSppwVdeuT24X9aTvlFOICClcsnC5Zp9B0n9bEnSbpgjEg+d2pq2kkisQg KWurGx5RVIxEaH4QwwgCE1ZNLnbVPPNG4tXyQRM3CycdeRbTTwShlTJBobp+G+kP3ZLU H+xA== X-Gm-Message-State: AOJu0YylbtxZnAmQiTweiCbhDmImzyTu3X/JcPwgff7sY65cp5fbNpzU 6eljRDQ9VIGApCM9kvDtXQfEgphkyKbQS5Dq8ie9aJRA7NNeYm94pHP3iDjCHGoOzJJZkoeDq1k IEd7GNRQXof2iqOBZSlzSv237FxaB1jqgIgO33DKQ X-Received: by 2002:a05:6808:2104:b0:3e0:3aa7:8967 with SMTP id 5614622812f47-3e271ba14cbmr5674057b6e.18.1727068788471; Sun, 22 Sep 2024 22:19:48 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:48 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:33 -0500 Message-Id: <20240923051941.54124-4-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 03/11] avformat/dvdvideodec: measure duration of the current menu VOBU in state 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: yKqmDIDgxrB3 This will be a pre-requisite to calculating chapter markers for menus. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index da41a9d329..18c356c132 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -474,6 +474,7 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState } state->vobu_e_ptm = pci.pci_gi.vobu_e_ptm; + state->vobu_duration = pci.pci_gi.vobu_e_ptm - pci.pci_gi.vobu_s_ptm; av_log(s, AV_LOG_DEBUG, "NAV packet: sector=%d " "vobu_s_ptm=%d vobu_e_ptm=%d ts_offset=%" PRId64 "\n", From patchwork Mon Sep 23 05:19:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51719 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2243880vqb; Sun, 22 Sep 2024 22:20:38 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX45ceBWS1+uAYnwzu911nlDkw7OdAf7EiM3rot9Dlp8GN+edJDZN/0nUkKProc9M+zWjpWFgGODSLGCIUNN0IK@gmail.com X-Google-Smtp-Source: AGHT+IEKIdZVoRrap+wd89pQPOPig8VEsgCB5+Jy8Hw7pB5q+VRyfQ7ma/vWE9AcWqqDCd39hkJq X-Received: by 2002:a05:6402:35d3:b0:5c5:b903:7d52 with SMTP id 4fb4d7f45d1cf-5c5b9037e30mr5837071a12.5.1727068838029; Sun, 22 Sep 2024 22:20:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727068838; cv=none; d=google.com; s=arc-20240605; b=Mt8NS+V/vue582Jbr86SnwhB3pAgpOpw5JH6HTSe4rkiW2B0s2J2YHKnSKE5XJtyVe xYndxGDUtRQf13bgap+ibvDsHN5PAXCU0u79/oMgiKEFeozJEwaHZ2zxt14Y5JWUrkrG TsSUhOVnohbhR7S9hyHlI6cjyaFjf9Ar9qE5C6fFrErh2WTXquLYJWMVvIf6QuYKeyIc Aubnx6qr1f15BTKMvjriFq8Cg5jsZ1FoWBIgeYeE4piGybHU/0tfX+dc8Z1zterfwzQ2 CGULkeIbv967pkB/vxOHqUh+jZdl6vZ4p6XUDcyH5/DYU7dbWkUUkEF+u3LhVFlvXgMS tlyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=PWyi+4jdZoaaasIF5w1y5hPcOi10vFBot5Nd2082xqw=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=FpOQ4ogmzNMomBoGy7yOz0zZ2cXReq+XztVbIk06qoVp1V4u14zaFdPB4Zs0RFWazc 1yMK/Lq24gMYiYAIdZKu0d/SicUoWCXpUIhPpEi+oos7I8+Pf2CoDOnT5poPwMOmcmK/ ZFUr+Zz0By6OyYKHD+qmPdoI9qZd+SyQqOBiQiinuud450dedqHPaeLYV2w8JufyPtHU wBmEGHYXC/S593HAPaN1+Y7S6wknw85nRA7yVUTSIxp7wV6kfSAEjsrTa9qxMDDwAaxn 6/UslgEXWatFSgM1Dr1rwBVNZ2aUP0tBnkbgeNstLW7nXQIvpHh8BADMMeBMSazjdhDu 4DVg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=P09UBGS3; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c459be605esi6399655a12.135.2024.09.22.22.20.37; Sun, 22 Sep 2024 22:20:38 -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=@proxyid.net header.s=google header.b=P09UBGS3; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 62F7A68DA7A; Mon, 23 Sep 2024 08:20:01 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f225.google.com (mail-oi1-f225.google.com [209.85.167.225]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 33F3568D942 for ; Mon, 23 Sep 2024 08:19:50 +0300 (EEST) Received: by mail-oi1-f225.google.com with SMTP id 5614622812f47-3e03d17365bso2419995b6e.1 for ; Sun, 22 Sep 2024 22:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068789; x=1727673589; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zDyjzyjNVd7q+OW0s58cT8Q1kbuIEe4FcBIHNrLT4m0=; b=P09UBGS3zJAFuBUP9lieGTUVBoqolzDkg+QXF8jhUxabY01mUqW9X6E8p/uNc68oeN X8pSejCBOIDgcSF++jHEcuSMuNumUDDu95W+pNwlNde8E7mBJqT5BU03OnmFAouxGthN 0ZsRdAe5jaiUuMfPi/q/CMaNtf1b6zSz+o8ZYwm9lQVzDftiLHPtJA7ZO73fq7RKcjVz 6V82t/kR5h7QHQ++/HOg91iIf3ozT+jc8yMyAtunsqd3CATKOm5DPZY/KIL5ZbZtaH7y XqD+vzmicVw2AVcQWEbqyKEsjlA0SXa5srHSVuAFff9JujJY8HCXq5ok5qIuQ0crKoCJ qwTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068789; x=1727673589; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zDyjzyjNVd7q+OW0s58cT8Q1kbuIEe4FcBIHNrLT4m0=; b=oKJ7JVUiPdlA3D9mMg2kwEYix+U5/6zytvr2EaAInb2Mk49pjikNQ3t/S3I7jPc3oM /7IjnKdil609Wp6IC4llrLrdek6J1zedX0+BK4we/5NlfUBExZr/6Dd7lFNuZadvB+kY maXESe2xJJtjBKkMn0QnS1+b0EFllOgyy64ieASTsQD21d43tXoXRrttCnnxQCbX6Cmh 65S++HiCsOEI6agYSNl38psJh3lY5nTGGM02GUj+J1UYu+mmk1sNpkm5ZHLhti1N852o ynfRtZZEgRB1ovm7oJYnnM99L/ioQ1irEsAY+NkaRN/R0eiNKcdRLTJy2F3vq2d1MHLq Zutw== X-Gm-Message-State: AOJu0YxpXXYqbpjHm6EKEEv0u+SyvWkmC5mVogjxDGDkLcPbZDcFmLAY kcDEKJDdzUm/xNVkCCMc3J2nflltjcAegEdvVimCyo5ZfFx5rLmODM/dwxLBlepahK0DxDTTe4R 7EBzwlw7IoHWCYSWDO5kvbdquTvuFV3VKGhWzgMe5 X-Received: by 2002:a05:6808:1b8f:b0:3e2:66ea:d5ef with SMTP id 5614622812f47-3e27290b1demr6790165b6e.5.1727068788843; Sun, 22 Sep 2024 22:19:48 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:48 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:34 -0500 Message-Id: <20240923051941.54124-5-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 04/11] avformat/dvdvideodec: remove "auto" value for -pg option, default to 1 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 4rzQpLjXl/N6 The default "auto" mode is effectively useless; the reasonable default use case is to use the first PG (segment) of the selected PGC for both menus and standard titles. Just default the value to 1, since the option is irrelevant unless -pgc is also set. Note that this should not break users using this advanced option. The "auto" mode errored and asked for a PG number regardless for non-menus, and for menus the mode simply defaulted to 1. Signed-off-by: Marth64 --- doc/demuxers.texi | 3 +-- libavformat/dvdvideodec.c | 31 +++++++++---------------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 04293c4813..74b68778bd 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -397,8 +397,7 @@ Default is 0, automatically resolve from value of @option{title}. The entry PG to start playback, in conjunction with @option{pgc}. Alternative to setting @option{title}. Chapter markers are not supported at this time. -Default is 0, automatically resolve from value of @option{title}, or -start from the beginning (PG 1) of the menu. +Default is 1, the first PG of the PGC. @item preindex @var{bool} Enable this to have accurate chapter (PTT) markers and duration measurement, diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 18c356c132..bed7c38ff6 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -537,7 +537,7 @@ static int dvdvideo_play_open(AVFormatContext *s, DVDVideoPlaybackState *state) goto end_dvdnav_error; } - if (c->opt_pgc > 0 && c->opt_pg > 0) { + if (c->opt_pgc > 0) { if (dvdnav_program_play(state->dvdnav, c->opt_title, c->opt_pgc, c->opt_pg) != DVDNAV_STATUS_OK) { av_log(s, AV_LOG_ERROR, "Unable to start playback at title %d, PGC %d, PG %d\n", c->opt_title, c->opt_pgc, c->opt_pg); @@ -1541,13 +1541,6 @@ static int dvdvideo_read_header(AVFormatContext *s) c->opt_menu_lu = 1; } - if (!c->opt_pg) { - av_log(s, AV_LOG_INFO, "Defaulting to menu PG #1. " - "This is not always desirable, validation suggested.\n"); - - c->opt_pg = 1; - } - if ((ret = dvdvideo_ifo_open(s)) < 0 || (ret = dvdvideo_menu_open(s, &c->play_state)) < 0 || (ret = dvdvideo_subdemux_open(s)) < 0 || @@ -1558,7 +1551,13 @@ static int dvdvideo_read_header(AVFormatContext *s) return 0; } - if (c->opt_chapter_end != 0 && c->opt_chapter_start > c->opt_chapter_end) { + if (c->opt_pgc && (c->opt_chapter_start > 1 || c->opt_chapter_end > 0 || c->opt_preindex)) { + av_log(s, AV_LOG_ERROR, "PGC extraction not compatible with chapter or preindex options\n"); + + return AVERROR(EINVAL); + } + + if (!c->opt_pgc && (c->opt_chapter_end != 0 && c->opt_chapter_start > c->opt_chapter_end)) { av_log(s, AV_LOG_ERROR, "Chapter (PTT) range [%d, %d] is invalid\n", c->opt_chapter_start, c->opt_chapter_end); @@ -1572,18 +1571,6 @@ static int dvdvideo_read_header(AVFormatContext *s) c->opt_title = 1; } - if (c->opt_pgc) { - if (c->opt_pg == 0) { - av_log(s, AV_LOG_ERROR, "Invalid coordinates. If -pgc is set, -pg must be set too.\n"); - - return AVERROR(EINVAL); - } else if (c->opt_chapter_start > 1 || c->opt_chapter_end > 0 || c->opt_preindex) { - av_log(s, AV_LOG_ERROR, "-pgc is not compatible with the -preindex or " - "-chapter_start/-chapter_end options\n"); - return AVERROR(EINVAL); - } - } - if ((ret = dvdvideo_ifo_open(s)) < 0) return ret; @@ -1761,7 +1748,7 @@ static const AVOption dvdvideo_options[] = { {"menu", "demux menu domain", OFFSET(opt_menu), AV_OPT_TYPE_BOOL, { .i64=0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, {"menu_lu", "menu language unit (0=auto)", OFFSET(opt_menu_lu), AV_OPT_TYPE_INT, { .i64=0 }, 0, 99, AV_OPT_FLAG_DECODING_PARAM }, {"menu_vts", "menu VTS (0=VMG main menu)", OFFSET(opt_menu_vts), AV_OPT_TYPE_INT, { .i64=0 }, 0, 99, AV_OPT_FLAG_DECODING_PARAM }, - {"pg", "entry PG number (0=auto)", OFFSET(opt_pg), AV_OPT_TYPE_INT, { .i64=0 }, 0, 255, AV_OPT_FLAG_DECODING_PARAM }, + {"pg", "entry PG number (when paired with PGC number)", OFFSET(opt_pg), AV_OPT_TYPE_INT, { .i64=1 }, 1, 255, AV_OPT_FLAG_DECODING_PARAM }, {"pgc", "entry PGC number (0=auto)", OFFSET(opt_pgc), AV_OPT_TYPE_INT, { .i64=0 }, 0, 999, AV_OPT_FLAG_DECODING_PARAM }, {"preindex", "enable for accurate chapter markers, slow (2-pass read)", OFFSET(opt_preindex), AV_OPT_TYPE_BOOL, { .i64=0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, {"region", "playback region number (0=free)", OFFSET(opt_region), AV_OPT_TYPE_INT, { .i64=0 }, 0, 8, AV_OPT_FLAG_DECODING_PARAM }, From patchwork Mon Sep 23 05:19:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51720 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2243921vqb; Sun, 22 Sep 2024 22:20:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWHOhT5QJz9Q0waVZ1T95MDYXv9O59J2B2/zVgF4NI60Q6seQ1VQerdUrAvigMhkB7ncfsBVfFnlw+AkpSFNKc+@gmail.com X-Google-Smtp-Source: AGHT+IHeC7XBnn2dnK454K3wwcphtLXNszeGjicHnBthucDTro5QldxJdce+LmvQ6RzTkRXKiVC/ X-Received: by 2002:a05:6402:13d6:b0:5c5:b6ee:e95b with SMTP id 4fb4d7f45d1cf-5c5b6eee984mr11800266a12.8.1727068848733; Sun, 22 Sep 2024 22:20:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727068848; cv=none; d=google.com; s=arc-20240605; b=konF/v3P4CY4bfSobWpP/i+e6sB9vcZyAO+lwrGbGZKg6Hn/mmiXK7QnXcm4Z9Bttf FG04P3bjY+cD8iLBHZ3dzGhz223HecVbMGYCHuGnso4WtksZTYZWNtT4f6MFicYsu0yz XiaafNSimxfN2r+y/Z5zCbjYOBz8LWr3kSfmInIarSDD2ylhO5dFf5BDN4FTF+wPnT+X b4Npc+TFsnr4ECSF4RLjDt80v6gc8BsvuGYtKYSipd+iiR5K+u1eIyisAdBAr4otQUbH F8veqSHi/0enLyvH3cameX4qDx4ny8qlyQRk/4c2UREqhaJa6/bWQnm6BO7HVWKOXulT nb5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=B2UDm2SaTNmwHxrFzbpRUbLgq8e1YBeW1OZshekDhEE=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=F/FbMYoJ5c+goZUxsTdkHMaUzFf86GJwfj78JiSeTtu1uMuq35sEaXCmhrIeSBnCps 2221o1+SSzeVI15a9cOlHu/zlV0uUFS/Ip+Kt36K76k2Pm486YPoh4lgUpV/skUJH2Ti ftBh/NJ2PElFmEP2xje/e/gUH/AoYX9yxFSWi1Hc7+BaG4gE7YV18NPQDGywPcHAIJmr wLV1qYIx1f+tRAcet4d9S8egk1mObnEHWv6DGFwW1vc+VGJUXi0R7jYFSRW1y7DZYq4R rOCU+VI3bDpulsqkd1qLnXIqpf+1hb+G721HK2J6BxTcg8rcGlO/G2e9v2ArOAAb6b0I 8+IQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=AefL0jb2; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c42bc9080bsi12609054a12.423.2024.09.22.22.20.48; Sun, 22 Sep 2024 22:20:48 -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=@proxyid.net header.s=google header.b=AefL0jb2; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 63EE368DB5E; Mon, 23 Sep 2024 08:20:02 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oo1-f100.google.com (mail-oo1-f100.google.com [209.85.161.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 92D8168D950 for ; Mon, 23 Sep 2024 08:19:50 +0300 (EEST) Received: by mail-oo1-f100.google.com with SMTP id 006d021491bc7-5e5a0519ef3so336246eaf.0 for ; Sun, 22 Sep 2024 22:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068789; x=1727673589; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hZBNkBBpP+81ox5d1SI+Y9Sma9ddr7DuEGWkkaDyoU8=; b=AefL0jb2qwofyPaTRn3UTxE9byOO3OFE3M8xtxuC+zxL+leQpiPq8wWwDtV3y5LrmS 7jUP1eTGzNkNe2Y5UAcf9VweX4lc/86OW9UE5kXX2a4xPSD94mJBgrw5s2fgDZtN6Ik8 Qf5/U917v35jwJ20XyltHWpKC84PSK+S6BFAllspO1rX0gFB10DbrNEmHn/cYHE6V8yQ W7S0DwWtBA50ncFdt/Kt+Iced34nMSW9GrwhQK7KwjnuuPhXQswdlDMzUFa0JZtXY72X V907AGyX/ioftfLoF+GiQGFLRSloVRrKHbESHYLEwlmdVHfTLzlweRlQHgreGdsTIbVe PZXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068789; x=1727673589; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hZBNkBBpP+81ox5d1SI+Y9Sma9ddr7DuEGWkkaDyoU8=; b=kJ7l2L8iehTdVTG598IV/frJ+1ejcvB1aRYICUWRaFR9Z3j27R439gw2XTRtJBRNCn CqCpfJ/v4PbpyeLPUeIkNZZZ+NVtbKyzW4/Gl1Bbk25087N2dPXtV7FlMfWOCZ0cnCW1 Gi7serBuc/KeuAZq1q84q9iOQ6srnX2MZF1lCWUSFvX9SIJqe1bn+n0IQXg0dcKZO9r5 0rUbGSLALecu9sp5GjYQcy0A5nXATf+RWw9sBM0xV+tOSkJ5KtteAyH+T975rCOcGbIU ktN9uWYVhVFYAKyZlLmGxd9eG3zH28UoJdce0+i7qhaJybbRySTabxuuzsgPnSNOJJUz VS4Q== X-Gm-Message-State: AOJu0YzWZcc26Ed8+LO5NFtlsj8c4FPF7j5WqKxELQ+LDHcu/4PTRHt7 VK7hsoAsD30/KyP+crItdMKJaIjFkrprl46x/KjQsJlmWkD9j2qSOegMjjeNjREsztLnsuzYcws gHTx+Ay24grL88FBE2R1lgsX7f1fDqH9bQNZZ+wWI X-Received: by 2002:a05:6820:2613:b0:5e1:efda:3991 with SMTP id 006d021491bc7-5e58b81cf7cmr4183872eaf.0.1727068789205; Sun, 22 Sep 2024 22:19:49 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.48 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:49 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:35 -0500 Message-Id: <20240923051941.54124-6-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 05/11] avformat/dvdvideodec: move memcpy below missed NAV packet warning 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: v0vSoy55IA/I Readability improvement; the warning can be bundled beneath the preceding validations rather than awkwardly between the memcpy and return. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index bed7c38ff6..9246ac0863 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -804,13 +804,13 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState return AVERROR_INPUT_CHANGED; } - memcpy(buf, &nav_buf, nav_len); - if (state->pgn != cur_pgn) av_log(s, AV_LOG_WARNING, "Unexpected PG change (expected=%d actual=%d); " "this could be due to a missed NAV packet\n", state->pgn, cur_pgn); + memcpy(buf, &nav_buf, nav_len); + (*p_nav_event) = nav_event; state->is_seeking = 0; From patchwork Mon Sep 23 05:19:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51721 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2243965vqb; Sun, 22 Sep 2024 22:20:59 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWXJM8OPqPYikrZ77qSKNo3ly/SYYBfjg6oU84VHZFDpJsNuAzs0iYq+mq6BR9I1DKoaeXcBRRkgkluzcR8B8Iy@gmail.com X-Google-Smtp-Source: AGHT+IFBp7XmToUKMyBpScxCg2CO2GsNzK5bkbCyi03MeOR/PdOgs1AzAeiZropybzAf0l+fOl+Y X-Received: by 2002:a2e:b890:0:b0:2f6:6074:db84 with SMTP id 38308e7fff4ca-2f7cb324cdcmr15100531fa.9.1727068859293; Sun, 22 Sep 2024 22:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727068859; cv=none; d=google.com; s=arc-20240605; b=Yr7iR1ko2pz/DSy+lMBPFrAgFhBX8J5SZe8VpN1Fv4YchfI5qytcSC1UKM60f6uI18 w1cbM9I5dJ/JWo99WNkuEh0cXNS3Au+/PZ/UWvp57pCkM9iaFixPy7oF8rpDJ0cKXip7 MOhnP4VLLZ0oLojaN9itOQt67HHLxTIJmD4YWi95jUrq52d8JbevqI49YgHL3aWNJBu8 dUxW5AbxGfC2tD3I313ahlCh4LhtdueIroMapb9yCdZb+g9nNEphEFhZ3l+XVrwVm3Q4 r/4cjNJwNIwd4jL9ggyVsPrX2ifz6jgHN8gmDetdIvzYW0WYsQjnwvnGVLSziR+HA5nq w2pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=7Qv04dprDBSRxWahRGow9JxTiCx5LqUdlZciFqG02h8=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=BABxHy8OvZsvLKzkdLuCeDwwGLYiHBPtfqi4bdjI+ArtAArM2f8+zx2IaAw3RAgaVl HCCJWyKWQXYv5XHwx829WmTByry4wBt8WhSVTkqY6UuVrV/54S/WnD99QOG3nsYXNlfS BZZKxJ0RpFY35sPl78X4bDsUh0T7RPRQ/ZOXC7bKTM+Yg6dgGxOp+nknfN2REc+OyWVM z4pw/+6ZHPmA5gCIIde1/8uiFSPk/J50rk8x90lafRyelqIpVqS9pmI5vqRcXfLKiRb5 eKQbdCf5PHWf1w5KLdYjxpwOzT7XeW0H5B+wGbYHjlPUi6SuWQWVSsUj1roH+Bq+7DXk s6uw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=gznUWrit; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 38308e7fff4ca-2f79d2db26csi53963281fa.170.2024.09.22.22.20.58; Sun, 22 Sep 2024 22:20:59 -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=@proxyid.net header.s=google header.b=gznUWrit; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 457D668DBE5; Mon, 23 Sep 2024 08:20:03 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oo1-f98.google.com (mail-oo1-f98.google.com [209.85.161.98]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0728168DA3A for ; Mon, 23 Sep 2024 08:19:51 +0300 (EEST) Received: by mail-oo1-f98.google.com with SMTP id 006d021491bc7-5d5f24d9df8so1822347eaf.2 for ; Sun, 22 Sep 2024 22:19:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068789; x=1727673589; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=KMKDoVhot4hLfrBo+A8hgTWyqdB/S/+xtYoKVXN/0K0=; b=gznUWritje4obXixANut0g4xQ8GRJi7JqYvCYzDnScUE2hAbGW+vO8o+reQf1PwHWP 70CuWvGns5qdO2cc2bg9iTPYR1a0uKQ/HlLZN0UmSuHv0R0ZtkF6cZBaoWsY9Ppm70gW sH0RywDqYMNol0M8t7rPB0ojxx5xtVVlcg1PVUgqXD45mbJ171nXCOaJGuNLm4uO4gxP FC44H9IPw04WRNgZ2sZSYBnz4D2vVirFIoLHghCwO6DlCEryTrAzMYhw+Mp9LREtsjjZ VeWRESkSTUgEdW7B7Z1BQ3xy9JF35ls6uZ11NbX1T1NpRSRehZS8Z4yuF4JCYRmT/aqj fZ3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068789; x=1727673589; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KMKDoVhot4hLfrBo+A8hgTWyqdB/S/+xtYoKVXN/0K0=; b=RJwuM/AQHEy0C09epwFiQOmIR7AcGx44G9fcrGO/KPnpkcXjJo3ClgzffuCtbecHPb NH333tamQQrHF4nWKJtwhUS4flu/UJBT0IkpJ61msjrMA1FjIiqhts6mmSo5H8S0hZTv C/GTOoTHgoEMdZ97b5WbFFWfVZPC+m4wnSGodaisXXD91T6LJQswI4D0Kcj2HE0qlbfx 1YCXat2VPeRagcTlXcQA0sDVnkS5QIuuZ6OQLAvHo8RV1oCXPoTaFoLP8w8yoRFuPrcW zSD2RZJHUP7PlHW+Vu+dM3h9fBnaFdTjLK7k4il6SU/Joid6XhA/1ngay9VuGFEeR8EU YpxA== X-Gm-Message-State: AOJu0YwdGxpoG4QiePP7g2F2JHg5Ko3vtAqqm6kd7NRLV/Y3+N5HczSY 3EDTgMiTIp8vUKkAicBvwPGg+QaWX4nbkpAvufq786mmGXRfEb0MkjeXb6GlCeUhb41wCXdwtRz O5h/xUT0LGZYBSVEQKDEXbbHdL2tMMWWKKrvmNkWR X-Received: by 2002:a05:6820:210:b0:5e1:de92:6b4c with SMTP id 006d021491bc7-5e58ba58eaamr5176901eaf.1.1727068789558; Sun, 22 Sep 2024 22:19:49 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:49 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:36 -0500 Message-Id: <20240923051941.54124-7-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 06/11] avformat/dvdvideodec: standardize the NAV packet event signal 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: UTAqtNIXbivE This consolidates the FFERROR_REDO handling of NAV packets to dvdvideo_subdemux_read_data(), is a pre-requisite to calculating chapter markers for menus, and a pre-requisite to fixing the frame desync issue when the subdemuxer is flushed. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 9246ac0863..066edaaa27 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -390,7 +390,7 @@ static int dvdvideo_menu_open(AVFormatContext *s, DVDVideoPlaybackState *state) } static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState *state, - uint8_t *buf, int buf_size, + uint8_t *buf, int buf_size, int *p_is_nav_packet, void (*flush_cb)(AVFormatContext *s)) { int64_t blocks_read = 0; @@ -398,6 +398,8 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState pci_t pci = (pci_t) {0}; dsi_t dsi = (dsi_t) {0}; + (*p_is_nav_packet) = 0; + if (buf_size != DVDVIDEO_BLOCK_SIZE) { av_log(s, AV_LOG_ERROR, "Invalid buffer size (expected=%d actual=%d)\n", DVDVIDEO_BLOCK_SIZE, buf_size); @@ -481,7 +483,9 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState dsi.dsi_gi.nv_pck_lbn, pci.pci_gi.vobu_s_ptm, pci.pci_gi.vobu_e_ptm, state->ts_offset); - return FFERROR_REDO; + (*p_is_nav_packet) = 1; + + return 0; } /* we are in the middle of a VOBU, so pass on the PS packet */ @@ -611,8 +615,7 @@ end_dvdnav_error: } static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState *state, - uint8_t *buf, int buf_size, - int *p_nav_event, + uint8_t *buf, int buf_size, int *p_is_nav_packet, void (*flush_cb)(AVFormatContext *s)) { DVDVideoDemuxContext *c = s->priv_data; @@ -627,6 +630,8 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState pci_t *e_pci; dsi_t *e_dsi; + (*p_is_nav_packet) = 0; + if (buf_size != DVDVIDEO_BLOCK_SIZE) { av_log(s, AV_LOG_ERROR, "Invalid buffer size (expected=%d actual=%d)\n", DVDVIDEO_BLOCK_SIZE, buf_size); @@ -780,9 +785,9 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState state->vobu_e_ptm = e_pci->pci_gi.vobu_e_ptm; - (*p_nav_event) = nav_event; + (*p_is_nav_packet) = 1; - return nav_len; + return 0; case DVDNAV_BLOCK_OK: if (!state->in_ps) { if (state->in_pgc) @@ -811,8 +816,6 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState memcpy(buf, &nav_buf, nav_len); - (*p_nav_event) = nav_event; - state->is_seeking = 0; return nav_len; @@ -1442,18 +1445,18 @@ static int dvdvideo_subdemux_read_data(void *opaque, uint8_t *buf, int buf_size) AVFormatContext *s = opaque; DVDVideoDemuxContext *c = s->priv_data; - int ret = 0; - int nav_event; + int ret; + int is_nav_packet; if (c->play_end) return AVERROR_EOF; if (c->opt_menu) - ret = dvdvideo_menu_next_ps_block(s, &c->play_state, buf, buf_size, + ret = dvdvideo_menu_next_ps_block(s, &c->play_state, buf, buf_size, &is_nav_packet, dvdvideo_subdemux_flush); else - ret = dvdvideo_play_next_ps_block(opaque, &c->play_state, buf, buf_size, - &nav_event, dvdvideo_subdemux_flush); + ret = dvdvideo_play_next_ps_block(s, &c->play_state, buf, buf_size, &is_nav_packet, + dvdvideo_subdemux_flush); if (ret == AVERROR_EOF) { c->mpeg_pb.pub.eof_reached = 1; @@ -1462,7 +1465,7 @@ static int dvdvideo_subdemux_read_data(void *opaque, uint8_t *buf, int buf_size) return AVERROR_EOF; } - if (ret >= 0 && nav_event == DVDNAV_NAV_PACKET) + if (ret == 0 && is_nav_packet) return FFERROR_REDO; return ret; From patchwork Mon Sep 23 05:19:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51722 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2245910vqb; Sun, 22 Sep 2024 22:29:17 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVDirAh7Hz71In/OnzQ4FlEOd2vuhKpPVvmwNJS7c111OZcKsSQWjfuRpsJrUoRMllPMfp1QXJqPUUe1EWXPXYt@gmail.com X-Google-Smtp-Source: AGHT+IGjpig5PAHz4b+/LmdUDYH+dRz8sQDf+ghaiNyfXFZwKimDyhBWg1eA/oqc2JtWgb+4KNCK X-Received: by 2002:a17:907:9444:b0:a8d:2faf:d341 with SMTP id a640c23a62f3a-a90d4fdf18emr1235165066b.10.1727069357564; Sun, 22 Sep 2024 22:29:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727069357; cv=none; d=google.com; s=arc-20240605; b=HsjYv8seYsvDNQlq0rSHhmfq0MYvOkV3Q1PzkiPYrSAk+qEw6pw606iYMADEXN6EE6 jVSXUEn2USmjMrjEFLBLTGHFORgsMNz57CpM1YUJUljRwftKErPFUJhIXcU33qdCKROE SL38+d2JGhP8M/ENF+AaK6Lo1omBqeUQ+9ijIHhlEXkvmv1QrOfGHKsx7PtzfXDOFotf w3X+OeB1jUgyUkgLnebp/j3ozjQXBPqCgZNU8DoI3+0RjvAsk9wkf3vNvqaslaIhvcQO VjgA05VB0qxoVuQ3ntOZcMlk5drykVJWZnTzsoN5/sutZqOpX+QXhmGvq6mNoCyyZzrW uM7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=U1rvw81cY55sRprpZy2+G2XwRhgQ8M5K9Y50kC6SeM4=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=k/VU6evhLy7I9UeR6uUXsrzDYCOphQPSlcH5d7gCsWrY15p1TgiBCikksdV2+6fPyR MnBAJEPAlougDfx0NU/5HWk9M9QXD8rgkJq2J4HbScB1bgIvcRhsiNO8j30mdqL8pvhz mtMDuBxxKvkT90p0YqGiAr90xNhsJ3EiVQwXhnpYfg/AHxRTh/nNTLG8kQUlM7UtCMlT 0Ey+FkV2jafzpiCm5kwkF0mHjaxWnlCOtWQtt6vbFcJBdxFjGkgfSrSdJnidybSvEBph GZwZz+l3LwGtF++VmofdPdxw4uT+8nB5S/tGXLAOHSoDE4azq2EkmyTiTDzyoEhbiruP 4Mjw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=aPryyKan; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a906109a234si1345290266b.181.2024.09.22.22.29.17; Sun, 22 Sep 2024 22:29:17 -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=@proxyid.net header.s=google header.b=aPryyKan; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 27D5D68DBE9; Mon, 23 Sep 2024 08:20:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oo1-f98.google.com (mail-oo1-f98.google.com [209.85.161.98]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5198D68DA3A for ; Mon, 23 Sep 2024 08:19:51 +0300 (EEST) Received: by mail-oo1-f98.google.com with SMTP id 006d021491bc7-5dc93fa5639so2064201eaf.1 for ; Sun, 22 Sep 2024 22:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068790; x=1727673590; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dv+9QsPaxdhTx3uEbz8qkYRyT2WbZAm/NLnb9voK3Bc=; b=aPryyKanv2UpVBy4FJ7TAFkxDfH6aa+CJ6pZ32ewGM2frrKoxCYv0rwKm2js6t7q7r ColUgPzihCFPSXavqLszg4Gc04z6OfuZVFWaQI3cRrau5uI9B3UMol5Ni/Xdwh+A/Rgz BEpZTHlBv0ErgmgrwuqUS05kc6vvhF2IU3RRAmq/q4u1EehtNVbF5zYajl3ZgQD5hAN9 1pl/PcZpmjRhOkdX+igZmVN12iAKSyE7mjXwyBK6EyTynmKRlto23nxrmTzx72F+Pxxj PlyLdmbPLaBHFrjEVCSFleFsABM8v77oRJaP/NEvEykjVMe/ifCPGTZOJYBVslYg1Vvu tPng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068790; x=1727673590; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dv+9QsPaxdhTx3uEbz8qkYRyT2WbZAm/NLnb9voK3Bc=; b=oyJlvjUPXTRJgtUdHTqICfyOfUf9sFUsK4PP57JygmfDnLuM/eYnzjjuhIKsax8zsV z/PA3HqV/cPU3sWASAGkDcPs3gx14ssGf+kU5eq8hG918yC5z0MntCHGGyIe49cWpdxW QYlmJjcXW9I0CT7YyHWHirF4IhGHlEDwvyZKrkCK6oYR0bRZoI930l2rEHHJIabio1ur 4cvit3yJ5NcV1edlnxoKYQszFR3Y1/38ldSXmUicIrmVJkO7D4vwolMNIjk7hDTok2hJ CIhI3PkuQAy3Jpj1S440brhSHd9ZWAGtM7l661NI/oubsKtJXwSTq16Vko2wSLORQK4R PTPQ== X-Gm-Message-State: AOJu0Yz/QKREvJofUPD2Ji3PDGbaw0/VX1FY33+2B5T7m0r6P3vEy4XV gnwndGv9HeY2fzr7zgfiIYXhwo6rkfMTa4AsRFGEuSm8vS/bdvNTrb/DOfx30kKIXf1vLCNVGlP 0MEE1tvj1h2jgKKjSc58YJhcyfVXNGSCFnG8kdXcu X-Received: by 2002:a05:6820:210:b0:5e3:b6f9:1f8e with SMTP id 006d021491bc7-5e58ba5ceb5mr5328800eaf.3.1727068789995; Sun, 22 Sep 2024 22:19:49 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.49 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:49 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:37 -0500 Message-Id: <20240923051941.54124-8-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 07/11] avformat/dvdvideodec: enable chapter calculation for menus 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: MajbcdF3LaAu Menus are generally segmented by cell, so use them as the marker delimiters. Requires preindex option to be enabled. Signed-off-by: Marth64 --- doc/demuxers.texi | 1 - libavformat/dvdvideodec.c | 53 ++++++++++++++++++++++++++------------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/doc/demuxers.texi b/doc/demuxers.texi index 74b68778bd..a03e80732a 100644 --- a/doc/demuxers.texi +++ b/doc/demuxers.texi @@ -405,7 +405,6 @@ which requires a slow second pass read in order to index the chapter marker timestamps from NAV packets. This is non-ideal extra work for real optical drives. It is recommended and faster to use this option with a backup of the DVD structure stored on a hard drive. Not compatible with @option{pgc} and @option{pg}. -Not applicable to menus. Default is 0, false. @item trim @var{bool} diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 066edaaa27..5df123ac44 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -909,19 +909,26 @@ static int dvdvideo_chapters_setup_preindex(AVFormatContext *s) { DVDVideoDemuxContext *c = s->priv_data; - int ret = 0, interrupt = 0; - int nb_chapters = 0, last_ptt = c->opt_chapter_start; + int ret, partn, last_partn; + int interrupt = 0, nb_chapters = 0; uint64_t cur_chapter_offset = 0, cur_chapter_duration = 0; DVDVideoPlaybackState state = {0}; uint8_t nav_buf[DVDVIDEO_BLOCK_SIZE]; - int nav_event; + int is_nav_packet; if (c->opt_chapter_start == c->opt_chapter_end) - return ret; + return 0; - if ((ret = dvdvideo_play_open(s, &state)) < 0) - return ret; + if (c->opt_menu) { + if ((ret = dvdvideo_menu_open(s, &state)) < 0) + return ret; + last_partn = state.celln; + } else { + if ((ret = dvdvideo_play_open(s, &state)) < 0) + return ret; + last_partn = c->opt_chapter_start; + } if (state.pgc->nr_of_programs == 1) goto end_close; @@ -930,15 +937,22 @@ static int dvdvideo_chapters_setup_preindex(AVFormatContext *s) "Indexing chapter markers, this will take a long time. Please wait...\n"); while (!(interrupt = ff_check_interrupt(&s->interrupt_callback))) { - ret = dvdvideo_play_next_ps_block(s, &state, nav_buf, DVDVIDEO_BLOCK_SIZE, - &nav_event, NULL); + if (c->opt_menu) + ret = dvdvideo_menu_next_ps_block(s, &state, nav_buf, DVDVIDEO_BLOCK_SIZE, &is_nav_packet, + NULL); + else + ret = dvdvideo_play_next_ps_block(s, &state, nav_buf, DVDVIDEO_BLOCK_SIZE, &is_nav_packet, + NULL); + if (ret < 0 && ret != AVERROR_EOF) goto end_close; - if (nav_event != DVDNAV_NAV_PACKET && ret != AVERROR_EOF) + if (!is_nav_packet && ret != AVERROR_EOF) continue; - if (state.ptt == last_ptt) { + partn = c->opt_menu ? state.celln : state.ptt; + + if (partn == last_partn) { cur_chapter_duration += state.vobu_duration; /* ensure we add the last chapter */ if (ret != AVERROR_EOF) @@ -957,7 +971,7 @@ static int dvdvideo_chapters_setup_preindex(AVFormatContext *s) cur_chapter_offset += cur_chapter_duration; cur_chapter_duration = state.vobu_duration; - last_ptt = state.ptt; + last_partn = partn; if (ret == AVERROR_EOF) break; @@ -977,7 +991,10 @@ static int dvdvideo_chapters_setup_preindex(AVFormatContext *s) ret = 0; end_close: - dvdvideo_play_close(s, &state); + if (c->opt_menu) + dvdvideo_menu_close(s, &state); + else + dvdvideo_play_close(s, &state); return ret; } @@ -1523,11 +1540,10 @@ static int dvdvideo_read_header(AVFormatContext *s) if (c->opt_menu) { if (c->opt_region || c->opt_title > 1 || - c->opt_preindex || c->opt_chapter_start > 1 || c->opt_chapter_end > 0) { av_log(s, AV_LOG_ERROR, "-menu is not compatible with the -region, -title, " - "-preindex, or -chapter_start/-chapter_end options\n"); + "or -chapter_start/-chapter_end options\n"); return AVERROR(EINVAL); } @@ -1544,10 +1560,11 @@ static int dvdvideo_read_header(AVFormatContext *s) c->opt_menu_lu = 1; } - if ((ret = dvdvideo_ifo_open(s)) < 0 || - (ret = dvdvideo_menu_open(s, &c->play_state)) < 0 || - (ret = dvdvideo_subdemux_open(s)) < 0 || - (ret = dvdvideo_video_stream_setup(s)) < 0 || + if ((ret = dvdvideo_ifo_open(s)) < 0 || + (c->opt_preindex && (ret = dvdvideo_chapters_setup_preindex(s)) < 0) || + (ret = dvdvideo_menu_open(s, &c->play_state)) < 0 || + (ret = dvdvideo_subdemux_open(s)) < 0 || + (ret = dvdvideo_video_stream_setup(s)) < 0 || (ret = dvdvideo_audio_stream_add_all(s)) < 0) return ret; From patchwork Mon Sep 23 05:19:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51726 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2245945vqb; Sun, 22 Sep 2024 22:29:25 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVilWBVf1/I7AX9oEChH/iTli1+KyCs/Daky8JE4L1FpV4YY3xbmIlWgTOJZlAsqtcMGvJXNrTQXAfcbx6zlDuh@gmail.com X-Google-Smtp-Source: AGHT+IGCMtweq3Fa3ABjmKyRLeNpzy9rr4nIbjNO2sPqmBfu5i3q5wBjLPh79ldIiksCzmpmPQU2 X-Received: by 2002:a05:6512:12cf:b0:530:ab86:1e with SMTP id 2adb3069b0e04-536acf6b2aamr4070487e87.6.1727069365433; Sun, 22 Sep 2024 22:29:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727069365; cv=none; d=google.com; s=arc-20240605; b=Y2EBbscjWGTl7rrmd8grS3WYeu4wxRIEW3WiCW374qJxhprf1suc3UT6nwOBKq9Wdq TOL3s4e9QgwUPYd+DorcSCnoHcQjGv2CpR0yhhu6kJAxG79FIRDrkudR+5qSefOGcwL8 1FJhOgVdH5S1Pvewn845uy7j2Dhw8k8NdOWc1hQhPZTyZQS6tPusO5tYcdbtnOaZtyj1 fcQwcuBOUhki/U4OrwRArEP+Y22M9DzP9iUu2TapKQgeqvFAAEHWl6MCXr5d/7eOi6dR 3Lugw7F3mriaX8JLxuahjEHE9FrYwItsXz7+rvcjjuCWRd1W4ciRTZJnF8axKBwQOjzy dOfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=NeNAEsJIpLWwnnGu3b29UJU18fUzOy2+VTjJwlay7SM=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=F+YNyL/U6k2lVSaAC2/8+jD2ghc639La3K/V40NZ22oftkbD2CmmpSZ7jcHhccjnfs 94TUxN/VvYnwquBd1PcKm2ZATnfPax9QG5iU+3uF32ZbIdphiLShBT/1YJVQqx9Ma8wS vB71tS2sYegEObJPYyBQP8nZ7cuQECSN8Uz4YoZ/oyFPiPTbkpSX9Kp0MHATnw7WfFG6 Lxg5wV1CFi6T27KDkqmyHU1Mie+OykOBQTXegP+jTz+C/LcFkJd/D/NPkWMVlR1duU/0 uWW8cYRVMPZrHjeFqLFAIkmZnzaEpM6qjv259D/YyTV2FDLpIryFzsaH3D2n5YuHs7HX abUQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=bA1eSqHY; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 2adb3069b0e04-5368708dc83si6995012e87.322.2024.09.22.22.29.25; Sun, 22 Sep 2024 22:29:25 -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=@proxyid.net header.s=google header.b=bA1eSqHY; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0E45C68DC1A; Mon, 23 Sep 2024 08:20:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oi1-f228.google.com (mail-oi1-f228.google.com [209.85.167.228]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BB7DC68D942 for ; Mon, 23 Sep 2024 08:19:51 +0300 (EEST) Received: by mail-oi1-f228.google.com with SMTP id 5614622812f47-3e03a5ed4d7so1814110b6e.1 for ; Sun, 22 Sep 2024 22:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068790; x=1727673590; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5fUUWOl+ACPGIxRlbGPhKPFhtlevfDAV2wuUXNwODnU=; b=bA1eSqHYLuVTUZY+44q2iGVXTKGCSpKAR1tgB8V70MCoNgKAZrzzyApMmqxs9ctCQk qcDtqLy+MGGlmHM4AyCCKeumfT+pUfTo3ltKuiq9PxEetIMyOti1H7xnz7whhQ84YcwT AgGVbtOzTsd+4SuX66U+YzL/qWAgn7SoOSz71ggvSyChBS5qOTTV+LUQzQwmYIFeUMKt GN1XbUhJ2AQta9pFlMI1Hr6OwBDlky7XoV+V2HHV0tlhsXOagjdBBp8UrSMm+iKz2AnT bJK8o279yDAMnDckcpV9u35EX5Mq7d5kmSDjZRbNs485erEEUj4RNkeppXDUUywzElNp Nwpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068790; x=1727673590; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5fUUWOl+ACPGIxRlbGPhKPFhtlevfDAV2wuUXNwODnU=; b=mp+b1S0BfRg3tFSgoOB2TvISlZzTgeYEMCw6I/xnZfWXY8wtG5/I0S/5sE8s5/RdW1 A1aNJ4FflqWe7Jz24liapcDwYAa0HV8GKV2Sz2F10lYnApqfoXgBMFbNJhB79eoCtUgO VEcbIrfwqukTJDQ4bz5VIdJazObjR3lG1lenzyF6dt8V3Cs7B+2FC0txdtA0s7OyKzGa 76s2pFSRflPlOCX4GDWProz3YRYVfgi1ugzXEGP/b/swp9aKs6ZQ6zm3XmQJze4I0KHW Rrr83SUUN8m8Pu8tDlF35nJVYO7h16PSiBIH66nOm0lYTql+hMFA/frjVlQLWq8kLDkw ffZw== X-Gm-Message-State: AOJu0Yz4R7rrGirdH1QQ6chm5ueRCC9HkkZmEZRSesLihKIiIQCIlpgX RBj8MYKqsLN3FbAe4YngjZmAsBU8oBdNT3mulFzkaRIrozv0FHN+6ThpbT2S6S+eRdar2qc1Xz7 J920OKTf7x7jBD/EEbGGyyptfYIeZ6BZPN2K6u8Xe X-Received: by 2002:a05:6808:1b8a:b0:3da:e219:bf with SMTP id 5614622812f47-3e271cf5113mr5959689b6e.43.1727068790336; Sun, 22 Sep 2024 22:19:50 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:50 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:38 -0500 Message-Id: <20240923051941.54124-9-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 08/11] avformat/dvdvideodec: simplify dvdvideo_read_packet() 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 3VAxUE5yYCs5 The function has a few branches where it discards frames via FFERROR_REDO; consolidate is via a goto block to simplify the function and improve readability. Logging still maintains all the relevant details for the reason of the discard. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 44 +++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 5df123ac44..ebcfdca9a5 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -1615,8 +1615,9 @@ static int dvdvideo_read_packet(AVFormatContext *s, AVPacket *pkt) DVDVideoDemuxContext *c = s->priv_data; int ret; - enum AVMediaType st_type; - int found_stream = 0; + int is_key = 0; + int st_mapped = 0; + AVStream *st_subdemux; if (c->play_end) return AVERROR_EOF; @@ -1629,32 +1630,27 @@ static int dvdvideo_read_packet(AVFormatContext *s, AVPacket *pkt) if (!c->segment_started) c->segment_started = 1; - st_type = c->mpeg_ctx->streams[pkt->stream_index]->codecpar->codec_type; + st_subdemux = c->mpeg_ctx->streams[pkt->stream_index]; + is_key = pkt->flags & AV_PKT_FLAG_KEY; /* map the subdemuxer stream to the parent demuxer's stream (by startcode) */ for (int i = 0; i < s->nb_streams; i++) { - if (s->streams[i]->id == c->mpeg_ctx->streams[pkt->stream_index]->id) { + if (s->streams[i]->id == st_subdemux->id) { pkt->stream_index = s->streams[i]->index; - found_stream = 1; + st_mapped = 1; + break; } } - if (!found_stream) { - av_log(s, AV_LOG_DEBUG, "discarding frame with stream that was not in IFO headers " - "(stream id=%d)\n", c->mpeg_ctx->streams[pkt->stream_index]->id); - - return FFERROR_REDO; - } + if (!st_mapped) + goto discard; if (pkt->pts != AV_NOPTS_VALUE && pkt->dts != AV_NOPTS_VALUE) { if (!c->play_started) { /* try to start at the beginning of a GOP */ - if (st_type != AVMEDIA_TYPE_VIDEO || !(pkt->flags & AV_PKT_FLAG_KEY)) { - av_log(s, AV_LOG_VERBOSE, "Discarding packet which is not a video keyframe or " - "with unset PTS/DTS at start\n"); - return FFERROR_REDO; - } + if (st_subdemux->codecpar->codec_type != AVMEDIA_TYPE_VIDEO || !is_key) + goto discard; c->first_pts = pkt->pts; c->play_started = 1; @@ -1663,13 +1659,8 @@ static int dvdvideo_read_packet(AVFormatContext *s, AVPacket *pkt) pkt->pts += c->play_state.ts_offset - c->first_pts; pkt->dts += c->play_state.ts_offset - c->first_pts; - if (pkt->pts < 0) { - av_log(s, AV_LOG_VERBOSE, "Discarding packet with negative PTS (st=%d pts=%" PRId64 "), " - "this is OK at start of playback\n", - pkt->stream_index, pkt->pts); - - return FFERROR_REDO; - } + if (pkt->pts < 0) + goto discard; } else { av_log(s, AV_LOG_WARNING, "Unset PTS or DTS @ st=%d pts=%" PRId64 " dts=%" PRId64 "\n", pkt->stream_index, pkt->pts, pkt->dts); @@ -1681,6 +1672,13 @@ static int dvdvideo_read_packet(AVFormatContext *s, AVPacket *pkt) c->play_state.ts_offset, c->first_pts); return c->play_end ? AVERROR_EOF : 0; + +discard: + av_log(s, st_mapped ? AV_LOG_VERBOSE : AV_LOG_DEBUG, + "Discarding frame @ st=%d pts=%" PRId64 " dts=%" PRId64 " is_key=%d st_mapped=%d\n", + st_mapped ? pkt->stream_index : -1, pkt->pts, pkt->dts, is_key, st_mapped); + + return FFERROR_REDO; } static int dvdvideo_close(AVFormatContext *s) From patchwork Mon Sep 23 05:19:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51725 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2245937vqb; Sun, 22 Sep 2024 22:29:23 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWc7t2xr1GoK84Z0LXJK9/LHf3LluzkkmkHnd3xBezw3TfACESl43OM/hT5fELmHf7libh+D6ahXXF8TU0Fzgkj@gmail.com X-Google-Smtp-Source: AGHT+IHDwFgy4U4gIejDwY073Sq9stzSxmE/Ptv9haOgL4Pi0qgKusS2h+8448fG9WfgLho1ItVh X-Received: by 2002:a05:6402:274c:b0:5c5:b73c:593 with SMTP id 4fb4d7f45d1cf-5c5b73c05b5mr6728163a12.17.1727069363641; Sun, 22 Sep 2024 22:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727069363; cv=none; d=google.com; s=arc-20240605; b=BA6a+FiGryOTxWzijj/ORKXjQqpDUxFuNm9Et/Miqh438CjiMS2aINxxPZM37m4LIF hkdLUHAd8SZIZYoISKCGfaRVowfkGEbXWk+BNbe6Pua1nOxK2W49OC0vquwBDuROQvdt fSHSD0f/EykzMWbRbf4CWzvR3wTv5cg4NiW4HpwfB0IIyiK1I4tlBhO6jXb98j/dNVne 9U/COQRdAH9CR8wG4OlBpcE2fI9z5j0hqHAGk6K2WnlwIKrxgONa3Wf3wJXYsuC+ibRn 6bILzpsFkBet6ssFvmUn+95HeT8ehToOjfbfM3vd/OSOKJdgl0BzpAX4bN2yGcvZEPbi Yqxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=AbEsFVnDOsNPGHO+z3YbA+/L7bROcI/DI41GkU02GFE=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=aTXo9Fg5SQ5FC+EOQZDH4egBU3DP0QWt0EBSwhSaEar+KRc36+7MTJF9DGSAcpcwH6 cDp5XZ+E3/wNy8ScZ0uf3yZf2DwTllIpgXuS2wxOLkdkFBYvymLyTYm+k0Ypo7Cz3SLU X+nkRpa5ScxLf8uVujAtg3DbeC2avhuqX952BmdmPAphDUPBKnk/vQo78eHGnpusJPRW gNwECERBmpsc6qZIrF7pEdPV8trO2yY6lY3JUJJEIRdlu7dBM0XKm0li48eILV4hcHu9 XHxADkzHUjspjff5xWXrszWlSeq2d1YV2hTG2SMSvb7XsR88nM0huCD+2vG+b+572wqF 46mQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=eowooVxz; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 4fb4d7f45d1cf-5c42bb5b3bfsi13511010a12.154.2024.09.22.22.29.22; Sun, 22 Sep 2024 22:29:23 -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=@proxyid.net header.s=google header.b=eowooVxz; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id DF13968DC25; Mon, 23 Sep 2024 08:20:05 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oo1-f100.google.com (mail-oo1-f100.google.com [209.85.161.100]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0EC9668D942 for ; Mon, 23 Sep 2024 08:19:52 +0300 (EEST) Received: by mail-oo1-f100.google.com with SMTP id 006d021491bc7-5e1b50feb9bso2630366eaf.1 for ; Sun, 22 Sep 2024 22:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068790; x=1727673590; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JKh1wULo5HLHZNy6igFsfhXvWfMZQ6uK0YNxTQyHxe0=; b=eowooVxz2nwjotwpaHaR3tON6d49GAYaudOFagzd1dfdwqG+5G/c2LpRNFsiCE6eVz UQhXow+qaEgWkAAhGlVcPY9HC0eDYwyPldsNiJofBnZxMb6MtvR/lMX29BcdETivGdaJ rtmifdlQmQskuVe5nvEPHtHqT0ScSAQXumJlfl/ue1L5kREyRi1la+ppZB4cS2JNyB5A Pc0vw9wWdUwYZ4lXJhN8I7NFbLfuntkbHSOui03iFIluBesPV0bPjLHd2WkLvt+qsiRk bPtO+iW11jkOGeKwiIxJLdKcqqO6C6VQFn/Jp47nOow1TLtF+2xXmQIduOMpdW1SWPzF eUfg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068790; x=1727673590; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JKh1wULo5HLHZNy6igFsfhXvWfMZQ6uK0YNxTQyHxe0=; b=PVI+9tinky/NHbNqKhn4N5vsik0HhFlGSBl3YvzZIS2OSyLdGsemqal4bnEe+F7Kih WUj6UVah/vSJzH78Yz0Eq8UceBJLItfvUF9xrulbsGARjhtfOSscoD+2gtsgky8b3XDv Bxh47kVXOoQHSaOZQe3tDmya3R+fRqpAX5aVktMh66H6E3bR+X5KAXBrFOiUeQN46eIc l+iuf3LVpoYmIkr2N2ZH9jKFyVvq/03dkHyDtkDYWYGAjR0PRb4b61AsbjNP3mXQdBfq 1kvRrmvfWcGG5gzgyA1O2WpAN/pOzKzzowK1dP2uXr6szOPVMbjIl1h8oglE6EIF3tmU LaDg== X-Gm-Message-State: AOJu0YxtY2A/4vCHKDBaVTJIHPwl+agLLg6FuDHzQ90FkPybZdbWpymp 0Ot50ug3nOpUNTGeVYkst+eh2SJBvMnw+JrssFsCxzcSMJttyOflzFA1ciFBplVBfZfCezkKZ+z O2gV65/Zz+cysyKx1HYmALHWEc6FQPt5f6JjD4y2T X-Received: by 2002:a05:6820:617:b0:5e1:e1a4:add1 with SMTP id 006d021491bc7-5e58d1965demr4258299eaf.7.1727068790708; Sun, 22 Sep 2024 22:19:50 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:50 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:39 -0500 Message-Id: <20240923051941.54124-10-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 09/11] avformat/dvdvideodec: reset the subdemuxer on discontinuity instead of flushing 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: uHKGkORkx+8e DVDs naturally consist of segmented MPEG-PS blobs within a VOB (i.e. VOBs are not linear). NAV packs set the segment boundaries. When switching between segments, discontinuities occur and thus the subdemuxer needs to be reset. The current approach to manage this is by invoking ff_read_frame_flush() on the subdemuxer context, via a callback function which is invoked during the menu or dvdnav block functions. The same subdemuxer context is used throughout the demux, with a stretched PTS wrap bits value (64) + disabled overflow correction, and then flushed on each segment. Eventually, a play_end context variable is set to declare EOF. However, this approach causes frame drops. The block read flushes the demuxer before the frame read is complete, causing frames to drop on discontinuity. The play_end signal likewise ends playback before the frame read is complete, causing frames to drop at end of the title. To compound the issue, the PTS wrap bits value of 64 is wrong; the VOBU limit is actually 32 and the overflow correction should work. Instead, EOF the MPEG-PS subdemuxer organically when each VOB segment ends, and re-open it if needed with the offset after the full frame read is complete. In doing so, correct the PTS wrap behavior to 32 bits and remove the play_end/segment_started signals and callback pattern. Note that the timestamps as reported by the NAV packets are known as "PTMs", so the fields storing the time prior to adjustment are renamed accordingly. This makes it more clear when we are offsetting the NAV packet reported timestamps versus what we present as a demuxer. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 139 ++++++++++++++++++++------------------ 1 file changed, 75 insertions(+), 64 deletions(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index ebcfdca9a5..6f947c3927 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -56,7 +56,7 @@ #define DVDVIDEO_MAX_PS_SEARCH_BLOCKS 128 #define DVDVIDEO_BLOCK_SIZE 2048 #define DVDVIDEO_TIME_BASE_Q (AVRational) { 1, 90000 } -#define DVDVIDEO_PTS_WRAP_BITS 64 /* VOBUs use 32 (PES allows 33) */ +#define DVDVIDEO_PTS_WRAP_BITS 32 /* VOBUs use 32 (PES allows 33) */ #define DVDVIDEO_LIBDVDX_LOG_BUFFER_SIZE 1024 #define PCI_START_BYTE 45 /* complement dvdread's DSI_START_BYTE */ @@ -115,8 +115,9 @@ typedef struct DVDVideoPlaybackState { int pgc_nb_pg_est; /* number of PGs as reported by IFOs */ int pgcn; /* ID of the PGC we are playing */ int pgn; /* ID of the PG we are in now */ + int ptm_discont; /* signal that a PTM discontinuity occurred */ + int64_t ptm_offset; /* PTM discontinuity offset (as NAV value) */ int ptt; /* ID of the chapter we are in now */ - int64_t ts_offset; /* PTS discontinuity offset (ex. VOB change) */ uint32_t vobu_duration; /* duration of the current VOBU */ uint32_t vobu_e_ptm; /* end PTM of the current VOBU */ int vtsn; /* ID of the active VTS (video title set) */ @@ -163,11 +164,11 @@ typedef struct DVDVideoDemuxContext { /* playback control */ int64_t first_pts; /* the PTS of the first video keyframe */ - int play_end; /* signal EOF to the parent demuxer */ - DVDVideoPlaybackState play_state; /* the active playback state */ int play_started; /* signal that playback has started */ int seek_warned; /* signal that we warned about seeking limits */ - int segment_started; /* signal that subdemuxer is on a segment */ + DVDVideoPlaybackState play_state; /* the active playback state */ + int64_t pts_offset; /* PTS discontinuity offset (ex. VOB change) */ + int subdemux_reset; /* signal that subdemuxer should be reset */ } DVDVideoDemuxContext; static void dvdvideo_libdvdread_log(void *opaque, dvd_logger_level_t level, @@ -390,8 +391,7 @@ static int dvdvideo_menu_open(AVFormatContext *s, DVDVideoPlaybackState *state) } static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState *state, - uint8_t *buf, int buf_size, int *p_is_nav_packet, - void (*flush_cb)(AVFormatContext *s)) + uint8_t *buf, int buf_size, int *p_is_nav_packet) { int64_t blocks_read = 0; uint8_t read_buf[DVDVIDEO_BLOCK_SIZE] = {0}; @@ -399,6 +399,7 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState dsi_t dsi = (dsi_t) {0}; (*p_is_nav_packet) = 0; + state->ptm_discont = 0; if (buf_size != DVDVIDEO_BLOCK_SIZE) { av_log(s, AV_LOG_ERROR, "Invalid buffer size (expected=%d actual=%d)\n", @@ -465,10 +466,8 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState if (state->in_pgc) { if (state->vobu_e_ptm != pci.pci_gi.vobu_s_ptm) { - if (flush_cb) - flush_cb(s); - - state->ts_offset += state->vobu_e_ptm - pci.pci_gi.vobu_s_ptm; + state->ptm_discont = 1; + state->ptm_offset += state->vobu_e_ptm - pci.pci_gi.vobu_s_ptm; } } else { state->in_pgc = 1; @@ -479,9 +478,10 @@ static int dvdvideo_menu_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState state->vobu_duration = pci.pci_gi.vobu_e_ptm - pci.pci_gi.vobu_s_ptm; av_log(s, AV_LOG_DEBUG, "NAV packet: sector=%d " - "vobu_s_ptm=%d vobu_e_ptm=%d ts_offset=%" PRId64 "\n", + "vobu_s_ptm=%d vobu_e_ptm=%d ptm_offset=%" PRId64 "\n", dsi.dsi_gi.nv_pck_lbn, - pci.pci_gi.vobu_s_ptm, pci.pci_gi.vobu_e_ptm, state->ts_offset); + pci.pci_gi.vobu_s_ptm, pci.pci_gi.vobu_e_ptm, state->ptm_offset); + (*p_is_nav_packet) = 1; @@ -615,8 +615,7 @@ end_dvdnav_error: } static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState *state, - uint8_t *buf, int buf_size, int *p_is_nav_packet, - void (*flush_cb)(AVFormatContext *s)) + uint8_t *buf, int buf_size, int *p_is_nav_packet) { DVDVideoDemuxContext *c = s->priv_data; @@ -631,6 +630,7 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState dsi_t *e_dsi; (*p_is_nav_packet) = 0; + state->ptm_discont = 0; if (buf_size != DVDVIDEO_BLOCK_SIZE) { av_log(s, AV_LOG_ERROR, "Invalid buffer size (expected=%d actual=%d)\n", @@ -776,10 +776,8 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState state->in_ps = 1; } else { if (state->vobu_e_ptm != e_pci->pci_gi.vobu_s_ptm) { - if (flush_cb) - flush_cb(s); - - state->ts_offset += state->vobu_e_ptm - e_pci->pci_gi.vobu_s_ptm; + state->ptm_discont = 1; + state->ptm_offset += state->vobu_e_ptm - e_pci->pci_gi.vobu_s_ptm; } } @@ -938,11 +936,9 @@ static int dvdvideo_chapters_setup_preindex(AVFormatContext *s) while (!(interrupt = ff_check_interrupt(&s->interrupt_callback))) { if (c->opt_menu) - ret = dvdvideo_menu_next_ps_block(s, &state, nav_buf, DVDVIDEO_BLOCK_SIZE, &is_nav_packet, - NULL); + ret = dvdvideo_menu_next_ps_block(s, &state, nav_buf, DVDVIDEO_BLOCK_SIZE, &is_nav_packet); else - ret = dvdvideo_play_next_ps_block(s, &state, nav_buf, DVDVIDEO_BLOCK_SIZE, &is_nav_packet, - NULL); + ret = dvdvideo_play_next_ps_block(s, &state, nav_buf, DVDVIDEO_BLOCK_SIZE, &is_nav_packet); if (ret < 0 && ret != AVERROR_EOF) goto end_close; @@ -1444,19 +1440,6 @@ static int dvdvideo_subp_stream_add_all(AVFormatContext *s) return 0; } -static void dvdvideo_subdemux_flush(AVFormatContext *s) -{ - DVDVideoDemuxContext *c = s->priv_data; - - if (!c->segment_started) - return; - - av_log(s, AV_LOG_DEBUG, "flushing sub-demuxer\n"); - avio_flush(&c->mpeg_pb.pub); - ff_read_frame_flush(c->mpeg_ctx); - c->segment_started = 0; -} - static int dvdvideo_subdemux_read_data(void *opaque, uint8_t *buf, int buf_size) { AVFormatContext *s = opaque; @@ -1465,25 +1448,32 @@ static int dvdvideo_subdemux_read_data(void *opaque, uint8_t *buf, int buf_size) int ret; int is_nav_packet; - if (c->play_end) - return AVERROR_EOF; - if (c->opt_menu) - ret = dvdvideo_menu_next_ps_block(s, &c->play_state, buf, buf_size, &is_nav_packet, - dvdvideo_subdemux_flush); + ret = dvdvideo_menu_next_ps_block(s, &c->play_state, buf, buf_size, &is_nav_packet); else - ret = dvdvideo_play_next_ps_block(s, &c->play_state, buf, buf_size, &is_nav_packet, - dvdvideo_subdemux_flush); + ret = dvdvideo_play_next_ps_block(s, &c->play_state, buf, buf_size, &is_nav_packet); - if (ret == AVERROR_EOF) { - c->mpeg_pb.pub.eof_reached = 1; - c->play_end = 1; + if (ret < 0) + goto subdemux_eof; - return AVERROR_EOF; - } + if (is_nav_packet) { + if (c->play_state.ptm_discont) { + c->subdemux_reset = 1; + + ret = AVERROR_EOF; + goto subdemux_eof; + } - if (ret == 0 && is_nav_packet) return FFERROR_REDO; + } + + return ret; + +subdemux_eof: + c->mpeg_pb.pub.eof_reached = 1; + c->mpeg_pb.pub.error = ret; + c->mpeg_pb.pub.read_packet = NULL; + c->mpeg_pb.pub.buf_end = c->mpeg_pb.pub.buf_ptr = c->mpeg_pb.pub.buffer; return ret; } @@ -1525,12 +1515,24 @@ static int dvdvideo_subdemux_open(AVFormatContext *s) c->mpeg_ctx->max_analyze_duration = 0; c->mpeg_ctx->interrupt_callback = s->interrupt_callback; c->mpeg_ctx->pb = &c->mpeg_pb.pub; - c->mpeg_ctx->correct_ts_overflow = 0; c->mpeg_ctx->io_open = NULL; return avformat_open_input(&c->mpeg_ctx, "", &ff_mpegps_demuxer.p, NULL); } +static int dvdvideo_subdemux_reset(AVFormatContext *s) +{ + int ret; + + av_log(s, AV_LOG_VERBOSE, "Resetting sub-demuxer\n"); + + dvdvideo_subdemux_close(s); + if ((ret = dvdvideo_subdemux_open(s)) < 0) + return ret; + + return 0; +} + static int dvdvideo_read_header(AVFormatContext *s) { DVDVideoDemuxContext *c = s->priv_data; @@ -1619,16 +1621,20 @@ static int dvdvideo_read_packet(AVFormatContext *s, AVPacket *pkt) int st_mapped = 0; AVStream *st_subdemux; - if (c->play_end) - return AVERROR_EOF; - ret = av_read_frame(c->mpeg_ctx, pkt); + if (ret < 0) { + if (c->subdemux_reset && ret == AVERROR_EOF) { + c->subdemux_reset = 0; + c->pts_offset = c->play_state.ptm_offset; - if (ret < 0) - return ret; + if ((ret = dvdvideo_subdemux_reset(s)) < 0) + return ret; + + return FFERROR_REDO; + } - if (!c->segment_started) - c->segment_started = 1; + return ret; + } st_subdemux = c->mpeg_ctx->streams[pkt->stream_index]; is_key = pkt->flags & AV_PKT_FLAG_KEY; @@ -1656,8 +1662,8 @@ static int dvdvideo_read_packet(AVFormatContext *s, AVPacket *pkt) c->play_started = 1; } - pkt->pts += c->play_state.ts_offset - c->first_pts; - pkt->dts += c->play_state.ts_offset - c->first_pts; + pkt->pts += c->pts_offset - c->first_pts; + pkt->dts += c->pts_offset - c->first_pts; if (pkt->pts < 0) goto discard; @@ -1667,11 +1673,11 @@ static int dvdvideo_read_packet(AVFormatContext *s, AVPacket *pkt) } av_log(s, AV_LOG_TRACE, "st=%d pts=%" PRId64 " dts=%" PRId64 " " - "ts_offset=%" PRId64 " first_pts=%" PRId64 "\n", + "pts_offset=%" PRId64 " first_pts=%" PRId64 "\n", pkt->stream_index, pkt->pts, pkt->dts, - c->play_state.ts_offset, c->first_pts); + c->pts_offset, c->first_pts); - return c->play_end ? AVERROR_EOF : 0; + return 0; discard: av_log(s, st_mapped ? AV_LOG_VERBOSE : AV_LOG_DEBUG, @@ -1700,6 +1706,7 @@ static int dvdvideo_close(AVFormatContext *s) static int dvdvideo_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags) { DVDVideoDemuxContext *c = s->priv_data; + int ret; int64_t new_nav_pts; pci_t* new_nav_pci; dsi_t* new_nav_dsi; @@ -1744,13 +1751,17 @@ static int dvdvideo_read_seek(AVFormatContext *s, int stream_index, int64_t time c->play_state.in_ps = 0; c->play_state.is_seeking = 1; c->play_state.nav_pts = timestamp; - c->play_state.ts_offset = timestamp; + c->play_state.ptm_offset = timestamp; + c->play_state.ptm_discont = 0; c->play_state.vobu_e_ptm = new_nav_pci->pci_gi.vobu_s_ptm; c->first_pts = 0; c->play_started = 0; + c->pts_offset = timestamp; + c->subdemux_reset = 0; - dvdvideo_subdemux_flush(s); + if ((ret = dvdvideo_subdemux_reset(s)) < 0) + return ret; av_log(s, AV_LOG_DEBUG, "seeking: requested_nav_pts=%" PRId64 " new_nav_pts=%" PRId64 "\n", timestamp, new_nav_pts); From patchwork Mon Sep 23 05:19:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51727 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2248309vqb; Sun, 22 Sep 2024 22:39:19 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVMC05YGevM8uXYjRnn91MfA4ibevkxcAWP15h5kT9gB1Gxv+kmYsVxXFUPTZHYBcJxrLsaimd4IUmfN1A/Ja2J@gmail.com X-Google-Smtp-Source: AGHT+IFepS08dVHDzAH1n03OqFbb2SmmdMwkK4pleZ9/xCe/5YjQUGT9le93nXb9pUWevi8rtcwp X-Received: by 2002:a05:651c:2117:b0:2ef:226e:e150 with SMTP id 38308e7fff4ca-2f7cb35b1e0mr62078301fa.32.1727069958908; Sun, 22 Sep 2024 22:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727069958; cv=none; d=google.com; s=arc-20240605; b=TKgpyIK7ITKHunG+VFtX2dT2PPercoA19CsTnXiNMUqwlKbZcPWGjes91Kb7mlH600 olvkf6ncsAo2Qwfnh1jh5dIGOiclB2xfWS76d3TRRuJZLsevAsleLJ/+nlzOuKWYd4Vk F62gf+GcnyLTNI0PXNz/fBZpDz5MBXxg19IjjdbIBOYiakbWwfPtXdmsMSFynG3lhYKx esvSU0YXrjulSpjRflxUHy0as43aCqCvasRUnTS6+x6LbXaz5H0JrXf8nw3qEpm7fZbL +Q6Ei70uCLXf4d4N/kvd/u/Jrz2d1gyOCax2cWYr0b+ngiSUJbw7/Ig58A74U3kv4i4d gXAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=hjmgp1KEPVFW+MLwdQiAEsnYCrq7GDZEQ3WULZQUEHs=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=TNrI5iUi0/N8ZAqbXySQ+uIxxRvW6Rm2HWVflPluyf/weZVSqO+8WW+VelpHt4Q01R w1pm95HtYnjbslCdw0S8L7AbQDky6Wv1YkkLHGy8EgRBbrSjSJCYMW2l0hlybqMIgYKY AQ8Pg949y7igDtE6mXshKb+oAmTxPD3bdvhusD0iJhXfNG1eRQ53NSWHpCRRBUChjZE9 y/uhmJuJpFMrPUsYsh7Ps56vq8J1qQVOSYX0+yduSeeVBt2MvnciiDarUPRsJwPUEDdG d4i9HYX5PfmBv5WSpF0Av3BZdAEk5Pv6rEJAlqeYIUhcQWOGWf43JXqeKZtBfLYOTK26 ijgA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b="W2LGld/a"; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 38308e7fff4ca-2f79d2db35dsi59059271fa.183.2024.09.22.22.39.18; Sun, 22 Sep 2024 22:39:18 -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=@proxyid.net header.s=google header.b="W2LGld/a"; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B0FE168DC32; Mon, 23 Sep 2024 08:20:06 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-oo1-f97.google.com (mail-oo1-f97.google.com [209.85.161.97]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8624768D942 for ; Mon, 23 Sep 2024 08:19:52 +0300 (EEST) Received: by mail-oo1-f97.google.com with SMTP id 006d021491bc7-5de8a3f1cc6so2156342eaf.1 for ; Sun, 22 Sep 2024 22:19:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068791; x=1727673591; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qfCVmxpVDXR/6QH2RGLWDdOBpclWmbJw9vQOvhVkIMs=; b=W2LGld/ap5jDSQL8sBhokyr2lzbgUZkltqGUnNmucWTWv7K4y3UDtkCCntsCV3Jk7y i0QHbmEK0SyUIAhBqXFAQORWskQHWFg1uNMgizWpXgCpeX0bfVyVkxQ6xGP8fOj958+H MBRKlVKPPtQneFEwejcCLOghy5e18Ug0uJ6po0r/C8XGT/9zYfyuOZqkP9xsvGTrhyyl KSSpqOpxhhkNGvU7wjYf/G12wFDzLLUiW9puBcHV8AYmBFfRCN9XC8xKNF86YG6GiHPn eL820m8VdXMMU0f2IEaSlSwXXRin+dvRvzKwNWWZP2mTn54ywvHav+fI1l1j6hQ+0uoG MqMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068791; x=1727673591; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qfCVmxpVDXR/6QH2RGLWDdOBpclWmbJw9vQOvhVkIMs=; b=o3j5K11R3ol1t8pKa9XQ+AnSr0NSb95LvG/39OWX5yBTOUcOxmrcNmV0jgO1CCrY81 AUJwJ2xfVsQElTlwlRmIvGulaudEdWvg6ww3p7Kix54zOijqeb2tXCrUKWVXc11YAF/U b98vmRbDz0apGTNaj99yHaQk+BncKE3u1qDtWfob3VMSUr5pQR4+Agg5TmT4fNogg5bi VFtRbP0F0N/qF5di6HShrgXBGNqjYuvaYzKpvYZR5yyl+bQ+Olj1GdWlfY/VLjKlGHP9 zyrWuwWI7fINJmy5ysueuOFMDL2FCc5CJBfewuxFnW8AwP26TA7GpdWgkIobZjsMOLdg NAbg== X-Gm-Message-State: AOJu0Yxo8MvSC9uz9pdFIDOkimDiY6jPv2z+PT3JZJDHN4/HulAy3weB 0vaQT+zJ7ja0H7uD6kc0PpY4f0J5rDPgINBjs4DbHIOkAZwE608DEVVSU0BO1OE6BjnjxY+lPmA 7PDYouwqT1SyOHLu4IelzW7EjZGc1BW10wUnzgQr1 X-Received: by 2002:a05:6820:808:b0:5df:83a7:9ddf with SMTP id 006d021491bc7-5e58b848b4emr5195401eaf.0.1727068791073; Sun, 22 Sep 2024 22:19:51 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:51 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:40 -0500 Message-Id: <20240923051941.54124-11-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 10/11] avformat/dvdvideodec: check the length of a NAV packet when reading titles 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: NABFhs+Zn5uy Some discs present titles with bogus NAV packets. We apply this check for menus and for title MPEG blocks, but we should also apply it for NAV packets during title demuxing. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index 6f947c3927..e1c335f270 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -740,6 +740,13 @@ static int dvdvideo_play_next_ps_block(AVFormatContext *s, DVDVideoPlaybackState return AVERROR_EOF; } + if (nav_len != DVDVIDEO_BLOCK_SIZE) { + av_log(s, AV_LOG_ERROR, "Invalid NAV packet size (expected=%d actual=%d)\n", + DVDVIDEO_BLOCK_SIZE, nav_len); + + return AVERROR_INVALIDDATA; + } + e_pci = dvdnav_get_current_nav_pci(state->dvdnav); e_dsi = dvdnav_get_current_nav_dsi(state->dvdnav); From patchwork Mon Sep 23 05:19:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marth64 X-Patchwork-Id: 51723 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2245929vqb; Sun, 22 Sep 2024 22:29:22 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWIC4Z6SbxCmqIu62sn/L4hJWOFAMD2yytmMWjuR03iT2tgc5woEJTOTHkmKAFpnVo8MNae/UtD8FxNUJC+U1tp@gmail.com X-Google-Smtp-Source: AGHT+IGlnwcucFE+NDMD1mcmABiVrAmIXwEVTwK/4EXhnFZjDB07sPUWy/kx5y67VhIGi4WpPAIi X-Received: by 2002:a17:907:2cc7:b0:a8d:29b7:ecfd with SMTP id a640c23a62f3a-a90d5157361mr1380649066b.54.1727069361944; Sun, 22 Sep 2024 22:29:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727069361; cv=none; d=google.com; s=arc-20240605; b=PgETtsSCw8fGmirECj151dwBJDZi9U6wrkYy0DH0p7X0vTcySi7m1ZWosllNLcYonp dZ/waPMLP84GzJYf1M+jlQAhuNXQIxmaGJ19IF2cBstgj0eH6mc7uCoXiB4khOPsIl6n 7A2RmuDtuLnPrzALXuEmBFdpkT+ZqITXu36Mcgx4LJrSp0Ayk1b4TnUtWHdfh4UHvWu/ JSUFT5FPoAMjZlYP2ps27Mgc55OrNTgtBbajxvXhO/F5gr7/DFcNe8rPTIQo5ipfJJV9 zb/igkOAoWXUUlmdZd00FWg7tnSiqqoNnTDRpILlKvLIfw4dnSijvXuaUsC8E2f976g0 /Kzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=lWI7YeadDYmv5svyLhRbnF2zuZgFTCUnXb4C1tN+xhY=; fh=PlWMzmI9LD2qGS7ipLrQl8z0iaQTLQLHzoGuXcBzpCg=; b=XuRqUqGl37Rx6wkaR7AUXEDuKNfBFMWO2GQLb/U70eRLbp3aNlhnEKYIfWI44hXlph 4JLlX97gRJy7YaTezCBokIwD3A7FzDeT6fLYLcP0XTkPIIughbhQgd87gR4ngPUQkyiE rvF73zK8fUb0YLKoLIio2eYLU3u3RSCk+viNoXV7YPVm1WGKEhB0hlk8SOOIKRTYG171 WReP4Row6rA+mwjhkrnuzHjVw6Xe15aKV4dJMrtjJBLkMI82/D/xFLPu4KmwmSAyZqLp P0ndqCzGSK7u7t4TiroO7H6l6suW1K6EN7q9VA1/WESgu1uq7O8DLPBKtChPVnZvUXkj xbAA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@proxyid.net header.s=google header.b=bMD1Xu7n; 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; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a906109a24bsi1366988666b.7.2024.09.22.22.29.21; Sun, 22 Sep 2024 22:29:21 -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=@proxyid.net header.s=google header.b=bMD1Xu7n; 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; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A49F068DC4B; Mon, 23 Sep 2024 08:20:07 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-ot1-f99.google.com (mail-ot1-f99.google.com [209.85.210.99]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5B00F68DB68 for ; Mon, 23 Sep 2024 08:19:53 +0300 (EEST) Received: by mail-ot1-f99.google.com with SMTP id 46e09a7af769-710dead5d2aso2393262a34.0 for ; Sun, 22 Sep 2024 22:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proxyid.net; s=google; t=1727068791; x=1727673591; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/c0KI3wzslJRcHNhAZ7vhHWK0jzFCL4j5mDi+AAeXu0=; b=bMD1Xu7n3NzTWtIf7Be2JkbcxVudDSvNAxMoHYbJe3svw9UBARfXpEG4BlPKZMseF3 OpgYyBTjKbqMc4LbSjN35YTXghXT68si8zutkxvMcrmw9tshrYKCYwMnOhhuSuotrEdm TJO2oohB9PKeCRMbytdPuBbQSi/DS01ZVoXiyJg9anXEsxbLQK3IT9MV5AdSlJ+gojcu tay5WmZmr0/r9BwuEIbQCJeAqWnwZb0fJ8XeWex0sgTsFDKoUUt/jUyHpUDqXh+f4d+6 cugMoTQRL98kl3wwITWY+4XwkZ8747u/gHGYQ7VbJnTuIsJuAuUG0Bkrlts8wlZ9J0pP WErA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727068791; x=1727673591; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/c0KI3wzslJRcHNhAZ7vhHWK0jzFCL4j5mDi+AAeXu0=; b=gKN2a2eTJ+fZLUM9AZWmx1HQy0hXWf9h+kDf4L5vGMsw219qlyBjTGatnMgTFOPwsf bPlyMPEjG+tzwFL0F5tGKEq4P0t4gNGCsNn6wvB3nMwj9Yo1N7NU+lgieM5PT92QEGZO 9brWp20d9D1ooJScqEvHhC/2Y1mL/OtpauQJMgIf3PgMikJMRJEZE1+eeyrIYCdn/Dxl 2N98CafTyQTooAr8rwUcjmTPuRC1o1//aEi4s0f06e6QaTtM7z34wzj5dRo6cIV2kasV jC0f4nX15cwxuX3ZHgyLcputCA5R99jJ4gIl9GHxHjZ6xEr7cuqu/UuDQN1MyxWGoHgf nDsA== X-Gm-Message-State: AOJu0YwEBXTDBthoR3tD0hMjJw6SoZAQgQbTaS0SkpGC+MlCEXTmAzKe H/FAo20hE7lOrQDZYpqBOIWQzjC8UcTSgT9JFZ5o2G6pv7sx871NO2+y87qj2L04omq0yxyy5PM qIcSkQoeS079BbgcgfqQjpCHRcDEhC7vPh9d/hkcl X-Received: by 2002:a05:6808:398c:b0:3e2:8698:5bda with SMTP id 5614622812f47-3e286985c2bmr1767652b6e.6.1727068791415; Sun, 22 Sep 2024 22:19:51 -0700 (PDT) Received: from localhost.localdomain (c-69-245-177-215.hsd1.il.comcast.net. [69.245.177.215]) by smtp-relay.gmail.com with ESMTPS id 006d021491bc7-5e3bc69661csm202010eaf.20.2024.09.22.22.19.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 22 Sep 2024 22:19:51 -0700 (PDT) X-Relaying-Domain: proxyid.net From: Marth64 To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 00:19:41 -0500 Message-Id: <20240923051941.54124-12-marth64@proxyid.net> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20240923051941.54124-1-marth64@proxyid.net> References: <20240923051941.54124-1-marth64@proxyid.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 11/11] avformat/dvdvideodec: default menu_vts option to 1 and clarify description 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: 8sL2hGJZXC90 Menu 0 is the VIDEO_TS root menu, which does not appear to be used commonly for menu segments. Instead, default to the menu of VTS 1. Signed-off-by: Marth64 --- libavformat/dvdvideodec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dvdvideodec.c b/libavformat/dvdvideodec.c index e1c335f270..7e872e5405 100644 --- a/libavformat/dvdvideodec.c +++ b/libavformat/dvdvideodec.c @@ -1783,7 +1783,7 @@ static const AVOption dvdvideo_options[] = { {"chapter_start", "entry chapter (PTT) number", OFFSET(opt_chapter_start), AV_OPT_TYPE_INT, { .i64=1 }, 1, 99, AV_OPT_FLAG_DECODING_PARAM }, {"menu", "demux menu domain", OFFSET(opt_menu), AV_OPT_TYPE_BOOL, { .i64=0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM }, {"menu_lu", "menu language unit (0=auto)", OFFSET(opt_menu_lu), AV_OPT_TYPE_INT, { .i64=0 }, 0, 99, AV_OPT_FLAG_DECODING_PARAM }, - {"menu_vts", "menu VTS (0=VMG main menu)", OFFSET(opt_menu_vts), AV_OPT_TYPE_INT, { .i64=0 }, 0, 99, AV_OPT_FLAG_DECODING_PARAM }, + {"menu_vts", "menu VTS (0=VMG root menu)", OFFSET(opt_menu_vts), AV_OPT_TYPE_INT, { .i64=1 }, 0, 99, AV_OPT_FLAG_DECODING_PARAM }, {"pg", "entry PG number (when paired with PGC number)", OFFSET(opt_pg), AV_OPT_TYPE_INT, { .i64=1 }, 1, 255, AV_OPT_FLAG_DECODING_PARAM }, {"pgc", "entry PGC number (0=auto)", OFFSET(opt_pgc), AV_OPT_TYPE_INT, { .i64=0 }, 0, 999, AV_OPT_FLAG_DECODING_PARAM }, {"preindex", "enable for accurate chapter markers, slow (2-pass read)", OFFSET(opt_preindex), AV_OPT_TYPE_BOOL, { .i64=0 }, 0, 1, AV_OPT_FLAG_DECODING_PARAM },