summaryrefslogtreecommitdiffstats
path: root/stream/stream_cdda.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-09-13 16:48:34 +0200
committerwm4 <wm4@nowhere>2019-09-13 17:31:59 +0200
commita9d83eac40c94f44d19fab7b6955331f10efe301 (patch)
tree151a76d57c17649b025e262f44fae5fb0eefd889 /stream/stream_cdda.c
parentcf36e3d15b31958927b81b9ec99793c3a99bafc2 (diff)
downloadmpv-a9d83eac40c94f44d19fab7b6955331f10efe301.tar.bz2
mpv-a9d83eac40c94f44d19fab7b6955331f10efe301.tar.xz
Remove optical disc fancification layers
This removes anything related to DVD/BD/CD that negatively affected the core code. It includes trying to rewrite timestamps (since DVDs and Blurays do not set packet stream timestamps to playback time, and can even have resets mid-stream), export of chapters, stream languages, export of title/track lists, and all that. Only basic seeking is supported. It is very much possible that seeking completely fails on some discs (on some parts of the timeline), because timestamp rewriting was removed. Note that I don't give a shit about optical media. If you want to watch them, rip them. Keeping some bare support for DVD/BD is the most I'm going to do to appease the type of lazy, obnoxious users who will care. There are other players which are better at optical discs.
Diffstat (limited to 'stream/stream_cdda.c')
-rw-r--r--stream/stream_cdda.c32
1 files changed, 0 insertions, 32 deletions
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index 7fd461a361..e99db3eda1 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -226,42 +226,10 @@ static void close_cdda(stream_t *s)
cdda_close(p->cd);
}
-static int get_track_by_sector(cdda_priv *p, unsigned int sector)
-{
- int i;
- for (i = p->cd->tracks; i >= 0; --i)
- if (p->cd->disc_toc[i].dwStartSector <= sector)
- break;
- return i;
-}
-
static int control(stream_t *stream, int cmd, void *arg)
{
cdda_priv *p = stream->priv;
switch (cmd) {
- case STREAM_CTRL_GET_NUM_CHAPTERS:
- {
- int start_track = get_track_by_sector(p, p->start_sector);
- int end_track = get_track_by_sector(p, p->end_sector);
- if (start_track == -1 || end_track == -1)
- return STREAM_ERROR;
- *(unsigned int *)arg = end_track + 1 - start_track;
- return STREAM_OK;
- }
- case STREAM_CTRL_GET_CHAPTER_TIME:
- {
- int track = *(double *)arg;
- int start_track = get_track_by_sector(p, p->start_sector);
- int end_track = get_track_by_sector(p, p->end_sector);
- track += start_track;
- if (track > end_track)
- return STREAM_ERROR;
- int64_t sector = p->cd->disc_toc[track].dwStartSector;
- int64_t pos = sector * CDIO_CD_FRAMESIZE_RAW;
- // Assume standard audio CD: 44.1khz, 2 channels, s16 samples
- *(double *)arg = pos / (44100.0 * 2 * 2);
- return STREAM_OK;
- }
case STREAM_CTRL_GET_SIZE:
*(int64_t *)arg =
(p->end_sector + 1 - p->start_sector) * CDIO_CD_FRAMESIZE_RAW;