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.
This commit is contained in:
Dudemanguy 2023-10-18 14:19:17 -05:00
parent 3504136d3f
commit 39247bd0b6
3 changed files with 4 additions and 9 deletions

View File

@ -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.

View File

@ -3524,11 +3524,6 @@ Disc Devices
``--cdda-overlap=<value>``
Force minimum overlap search during verification to <value> 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=<value>``
Add ``<value>`` sectors to the values reported when addressing tracks.
May be negative.

View File

@ -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;