From a9d83eac40c94f44d19fab7b6955331f10efe301 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 13 Sep 2019 16:48:34 +0200 Subject: 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. --- stream/stream_cdda.c | 32 -------------------------------- 1 file changed, 32 deletions(-) (limited to 'stream/stream_cdda.c') 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; -- cgit v1.2.3