mirror of
https://github.com/mpv-player/mpv
synced 2024-12-25 08:12:17 +00:00
stream_dvdnav: ok, this makes no sense at all
The dvdnav API reads in 2K blocks (dvdnav_get_next_block()). The mpv wrapper (fill_buffer() in this file) expects that the read size done by the mpv core is at least 2K for this reason. If not, it returns an error. This used to be OK, because there was a thing called section alignment in the core code. This was removed because the core shouldn't suffer from optical disc idiosyncrasies. Which means that ever since, it has been working only by coincidence, or maybe not at all. Fixing this would require keeping a buffer in the priv struct, and returning it piece by piece if the core makes smaller reads. I have no intention of writing such code, so add an error message asking for a patch. If anyone actually cares about DVD, maybe it'll get fixed.
This commit is contained in:
parent
6fc0e7e0a0
commit
ca75fedaf4
@ -262,8 +262,11 @@ static int fill_buffer(stream_t *s, void *buf, int max_len)
|
||||
struct priv *priv = s->priv;
|
||||
dvdnav_t *dvdnav = priv->dvdnav;
|
||||
|
||||
if (max_len < 2048)
|
||||
if (max_len < 2048) {
|
||||
MP_FATAL(s, "Short read size. Data corruption will follow. Please "
|
||||
"provide a patch.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
int len = -1;
|
||||
|
Loading…
Reference in New Issue
Block a user