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.
This commit is contained in:
Dudemanguy 2023-10-18 13:11:06 -05:00
parent d5e5c2ce98
commit 3504136d3f
1 changed files with 0 additions and 9 deletions

View File

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