contrib: dvdread: fix cache not invalidated
authorThomas Guillem <thomas@gllm.fr>
Mon, 14 Jan 2019 10:48:15 +0000 (11:48 +0100)
committerThomas Guillem <thomas@gllm.fr>
Mon, 14 Jan 2019 10:48:29 +0000 (11:48 +0100)
contrib/src/dvdread/0001-Invalidate-cache-when-forcing-filesize.patch [new file with mode: 0644]
contrib/src/dvdread/rules.mak

diff --git a/contrib/src/dvdread/0001-Invalidate-cache-when-forcing-filesize.patch b/contrib/src/dvdread/0001-Invalidate-cache-when-forcing-filesize.patch
new file mode 100644 (file)
index 0000000..db2be4e
--- /dev/null
@@ -0,0 +1,26 @@
+From 978c6275c004db5485fb7ffde2508b89cc45c7f7 Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <thomas@gllm.fr>
+Date: Tue, 8 Jan 2019 15:51:08 +0100
+Subject: [PATCH] Invalidate cache when forcing filesize
+
+This fixes playback of Resident Evil Extention DVD.
+---
+ src/dvd_reader.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/dvd_reader.c b/src/dvd_reader.c
+index 4e112d3..b700dd5 100644
+--- a/src/dvd_reader.c
++++ b/src/dvd_reader.c
+@@ -1332,6 +1332,8 @@ int DVDFileSeekForce(dvd_file_t *dvd_file, int offset, int force_size)
+       force_size = (offset - 1) / DVD_VIDEO_LB_LEN + 1;
+     if( dvd_file->filesize < force_size ) {
+       dvd_file->filesize = force_size;
++      free(dvd_file->cache);
++      dvd_file->cache = NULL;
+       fprintf(stderr, "libdvdread: Ignored size of file indicated in UDF.\n");
+     }
+   }
+-- 
+2.20.1
+
index 2a69ee6..2dea43a 100644 (file)
@@ -18,6 +18,7 @@ $(TARBALLS)/libdvdread-$(LIBDVDREAD_VERSION).tar.bz2:
 
 dvdread: libdvdread-$(LIBDVDREAD_VERSION).tar.bz2 .sum-dvdread
        $(UNPACK)
+       $(APPLY) $(SRC)/dvdread/0001-Invalidate-cache-when-forcing-filesize.patch
        cd $(UNPACK_DIR) && sed -i -e 's,Requires.private,Requires,g' misc/*.pc.in
        $(MOVE)