From 3504136d3ff8728ae2ea841bc4309cc07138f113 Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Wed, 18 Oct 2023 13:11:06 -0500 Subject: [PATCH] stream_cdda: remove printing track info in fill_buffer It was completely wrong. mpv will buffer data ahead of where the CD currently is playing. When enough data was buffered into the next track, the track info is printed regardless of where the stream position actually is. Depending on the user settings, you can get mpv to buffer minutes ahead. Printing a message when the track changes might be nice, but this isn't the right place to do it. Some other mechanism would need to be leveraged, but I'm not going to bother figuring it out. --- stream/stream_cdda.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c index f73c84a0da..c719c45363 100644 --- a/stream/stream_cdda.c +++ b/stream/stream_cdda.c @@ -134,7 +134,6 @@ static void cdparanoia_callback(long int inpos, paranoia_cb_mode_t function) static int fill_buffer(stream_t *s, void *buffer, int max_len) { cdda_priv *p = (cdda_priv *)s->priv; - int i; if (!p->data || p->data_pos >= CDIO_CD_FRAMESIZE_RAW) { if ((p->sector < p->start_sector) || (p->sector > p->end_sector)) @@ -151,14 +150,6 @@ static int fill_buffer(stream_t *s, void *buffer, int max_len) size_t copy = MPMIN(CDIO_CD_FRAMESIZE_RAW - p->data_pos, max_len); memcpy(buffer, p->data + p->data_pos, copy); p->data_pos += copy; - - for (i = 0; i < p->cd->tracks; i++) { - if (p->cd->disc_toc[i].dwStartSector == p->sector - 1) { - print_track_info(s, i + 1); - break; - } - } - return copy; }