[libbluray-devel] Use binary flag for file_open()

tourettes git at videolan.org
Sun Feb 1 13:08:38 CET 2015


libbluray | branch: master | tourettes <tourettes at team-mediaportal.com> | Sat Jan 31 16:09:43 2015 +0200| [36c4f2020ff55c3953d22cbeb7b92894d0a27078] | committer: npzacs

Use binary flag for file_open()

This is required to avoid Windows C runtime doing any charset conversions for binary files

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=36c4f2020ff55c3953d22cbeb7b92894d0a27078
---

 src/libbluray/disc/disc.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libbluray/disc/disc.c b/src/libbluray/disc/disc.c
index 9a5fb3b..8b87669 100644
--- a/src/libbluray/disc/disc.c
+++ b/src/libbluray/disc/disc.c
@@ -121,7 +121,7 @@ BD_FILE_H *disc_open_path(BD_DISC *p, const char *rel_path)
     char *path;
 
     path = str_printf("%s%s", p->disc_root, rel_path);
-    fp = file_open(path, "r");
+    fp = file_open(path, "rb");
 
     if (!fp) {
         BD_DEBUG(DBG_FILE | DBG_CRIT, "error opening file %s\n", path);
@@ -138,7 +138,7 @@ BD_FILE_H *disc_open_file(BD_DISC *p, const char *dir, const char *file)
     char *path;
 
     path = str_printf("%s%s%c%s", p->disc_root, dir, DIR_SEP_CHAR, file);
-    fp = file_open(path, "r");
+    fp = file_open(path, "rb");
 
     if (!fp) {
         BD_DEBUG(DBG_FILE | DBG_CRIT, "error opening file %s\n", path);



More information about the libbluray-devel mailing list