summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2019-11-07 15:37:18 +0100
committerwm4 <wm4@nowhere>2019-11-07 22:53:13 +0100
commitca75fedaf4dea19986159f1caa5ab9ebc202f9d4 (patch)
treeaf382b893723ec0a63a91660cd794c5394c564b9
parent6fc0e7e0a0c63c6f8dd397e668bf2cd57b1f4beb (diff)
downloadmpv-ca75fedaf4dea19986159f1caa5ab9ebc202f9d4.tar.bz2
mpv-ca75fedaf4dea19986159f1caa5ab9ebc202f9d4.tar.xz
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.
-rw-r--r--stream/stream_dvdnav.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index d5090cfa69..a042508c2a 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -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;