From 39247bd0b68042d7ed3636085f071b8c7326c531 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 18 Oct 2023 14:19:17 -0500 Subject: [PATCH] stream_cdda: deprecate --cdda-toc-bias and always check for offsets I started going through the blame but once I got to mplayer commits from 20 years ago, I stopped bothering. This obscure option has always been disabled by default, but there's zero reason, as far as I know, to not just enable it today. Some CDs (particularly very old ones) have the first sector shifted a bit and not starting exactly at 0. This makes the logic that tries to get all the chapters completely fail and thus you can't skip through tracks. However if you just enable this obscure option, it just works. For anything that starts exactly at 0, the calculated offset is just 0 anyway so it's a no-op and works exactly the same. So basically, there's literally no reason to not just always try to correct for the offset of the first sector by default. Fixes #8777. --- DOCS/interface-changes.rst | 1 + DOCS/man/options.rst | 5 ----- stream/stream_cdda.c | 7 +++---- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/DOCS/interface-changes.rst b/DOCS/interface-changes.rst index 47af1a0bd6..1d8a2592eb 100644 --- a/DOCS/interface-changes.rst +++ b/DOCS/interface-changes.rst @@ -99,6 +99,7 @@ Interface changes - change the default of `metadata-codepage` to `auto` - add `playlist-next-playlist` and `playlist-prev-playlist` commands - change `video-codec` to show description or name, not both + - deprecate `--cdda-toc-bias` option, offsets are always checked now --- mpv 0.36.0 --- - add `--target-contrast` - Target luminance value is now also applied when ICC profile is used. diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst index c2869e3de6..79171dc5dc 100644 --- a/DOCS/man/options.rst +++ b/DOCS/man/options.rst @@ -3524,11 +3524,6 @@ Disc Devices ``--cdda-overlap=`` Force minimum overlap search during verification to sectors. -``--cdda-toc-bias`` - Assume that the beginning offset of track 1 as reported in the TOC - will be addressed as LBA 0. Some discs need this for getting track - boundaries correctly. - ``--cdda-toc-offset=`` Add ```` sectors to the values reported when addressing tracks. May be negative. diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index c719c45363..71ae461493 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -74,7 +74,8 @@ const struct m_sub_options stream_cdda_conf = { {"paranoia", OPT_INT(paranoia_mode), M_RANGE(0, 2)}, {"sector-size", OPT_INT(sector_size), M_RANGE(1, 100)}, {"overlap", OPT_INT(search_overlap), M_RANGE(0, 75)}, - {"toc-bias", OPT_INT(toc_bias)}, + {"toc-bias", OPT_INT(toc_bias), + .deprecation_message = "toc-bias is no longer used"}, {"toc-offset", OPT_INT(toc_offset)}, {"skip", OPT_BOOL(skip)}, {"span-a", OPT_INT(span[0])}, @@ -284,9 +285,7 @@ static int open_cdda(stream_t *st) priv->cd = cdd; - if (p->toc_bias) - offset -= cdda_track_firstsector(cdd, 1); - + offset -= cdda_track_firstsector(cdd, 1); if (offset) { for (int n = 0; n < cdd->tracks + 1; n++) cdd->disc_toc[n].dwStartSector += offset;