Skip to content

Commit

Permalink
stream_cdda: deprecate --cdda-toc-bias and always check for offsets
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dudemanguy committed Oct 19, 2023
1 parent 3504136 commit 39247bd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions DOCS/interface-changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 0 additions & 5 deletions DOCS/man/options.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 3 additions & 4 deletions stream/stream_cdda.c
Original file line number Diff line number Diff line change
Expand Up @@ -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])},
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 39247bd

Please sign in to comment.