aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVoyager1 <voyager@xbmc.org>2013-05-13 00:45:11 -0700
committerVoyager1 <voyager@xbmc.org>2013-05-13 00:45:11 -0700
commitd38b14e8e53dca4bb6d90b536aef3e8dcb374f95 (patch)
tree5e21d0e39fe02532ed1a31fcf6a7432e01a955b2 /lib
parent846ccff2d81853d3f1e5a3cba870a3df37dd9c28 (diff)
parent56b4e565a6a9cf740f4e06d6813e23ab8d524d93 (diff)
Merge pull request #2723 from Voyager1/libdvdread-fix
Libdvdread fix for SMB, NFS, VIDEO_TS files (non-Windows platforms). fixes #14316
Diffstat (limited to 'lib')
-rw-r--r--lib/libdvd/libdvdread/src/dvd_reader.c3
-rw-r--r--lib/libdvd/patches/02-libdvdread_dvd_reader.c.diff87
-rw-r--r--lib/libdvd/patches/02-libdvdread_fix_symlinks_resolution_vfs.diff34
3 files changed, 37 insertions, 87 deletions
diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
index d7ff12eb00..f5ee550404 100644
--- a/lib/libdvd/libdvdread/src/dvd_reader.c
+++ b/lib/libdvd/libdvdread/src/dvd_reader.c
@@ -429,6 +429,9 @@ dvd_reader_t *DVDOpen( const char *ppath )
/* Also WIN32 does not have symlinks, so we don't need this bit of code. */
/* Resolve any symlinks and get the absolute dir name. */
+#if defined(_XBMC) /* for XBMC, only do symlink resolution for (real) non-xbmc-VFS paths */
+ if ( path[0] == '/' )
+#endif // _XBMC
{
if( ( cdir = open( ".", O_RDONLY ) ) >= 0 ) {
if( chdir( path_copy ) == -1 ) {
diff --git a/lib/libdvd/patches/02-libdvdread_dvd_reader.c.diff b/lib/libdvd/patches/02-libdvdread_dvd_reader.c.diff
deleted file mode 100644
index a49c0e741f..0000000000
--- a/lib/libdvd/patches/02-libdvdread_dvd_reader.c.diff
+++ /dev/null
@@ -1,87 +0,0 @@
-From 3708d886958258fcf18fe827eb8ab32ecda45943 Mon Sep 17 00:00:00 2001
-From: Voyager1 <voyager@xbmc.org>
-Date: Wed, 20 Feb 2013 19:47:34 +0100
-Subject: [PATCH 1/3] Fix inability of libdvd 4.2.0 to read DVDs stored as
- VIDEO_TS files on non-Windows OSs. Fixes
- http://trac.xbmc.org/ticket/14115.
-
----
- lib/libdvd/libdvdread/src/dvd_reader.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
-index d9544b3..2b3562f 100644
---- a/lib/libdvd/libdvdread/src/dvd_reader.c
-+++ b/lib/libdvd/libdvdread/src/dvd_reader.c
-@@ -445,7 +445,11 @@ dvd_reader_t *DVDOpen( const char *ppath )
- close( cdir );
- cdir = -1;
- if( retval == -1 ) {
-+#if defined(_XBMC)
-+ perror("libdvdread: failed to reset working directory to \".\""); /* but ignore error */
-+#else
- goto DVDOpen_error;
-+#endif // _XBMC
- }
- path_copy = new_path;
- new_path = NULL;
---
-1.7.9.4
-
-From cffa18401f642b35a91de7e5b1e184f1dc0bef6d Mon Sep 17 00:00:00 2001
-From: Voyager1 <voyager@xbmc.org>
-Date: Thu, 21 Feb 2013 20:07:03 +0100
-Subject: [PATCH 2/3] libdvdread: replace perror by fprintf so that it gets
- picked up in xbmc logs
-
----
- lib/libdvd/libdvdread/src/dvd_reader.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
-index 2b3562f..38a3812 100644
---- a/lib/libdvd/libdvdread/src/dvd_reader.c
-+++ b/lib/libdvd/libdvdread/src/dvd_reader.c
-@@ -446,7 +446,7 @@ dvd_reader_t *DVDOpen( const char *ppath )
- cdir = -1;
- if( retval == -1 ) {
- #if defined(_XBMC)
-- perror("libdvdread: failed to reset working directory to \".\""); /* but ignore error */
-+ fprintf( stderr, "libdvdread: failed to reset working directory to \".\": %s\n", strerror(errno)); /* but ignore error */
- #else
- goto DVDOpen_error;
- #endif // _XBMC
---
-1.7.9.4
-
-From cb345a7e3cde07506bf3a2d696fcbb3dff44477d Mon Sep 17 00:00:00 2001
-From: Memphiz <memphis@machzwo.de>
-Date: Sat, 20 Apr 2013 01:04:53 +0200
-Subject: [PATCH 3/3] [dvdread] - don't check the return value of chdir in
- xbmc - this function is not wrapped and might fail (and
- so will the whole dvd open in that case). This is non
- fatal for our vfs!
-
----
- lib/libdvd/libdvdread/src/dvd_reader.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
-index 38a3812..d7ff12e 100644
---- a/lib/libdvd/libdvdread/src/dvd_reader.c
-+++ b/lib/libdvd/libdvdread/src/dvd_reader.c
-@@ -432,7 +432,11 @@ dvd_reader_t *DVDOpen( const char *ppath )
- {
- if( ( cdir = open( ".", O_RDONLY ) ) >= 0 ) {
- if( chdir( path_copy ) == -1 ) {
-+#if defined(_XBMC)
-+ fprintf( stderr, "libdvdread: failed to change working directory to \"%s\": %s\n", path_copy, strerror(errno)); /* but ignore error */
-+#else
- goto DVDOpen_error;
-+#endif // _XBMC
- }
- new_path = malloc(PATH_MAX+1);
- if(!new_path) {
---
-1.7.9.4
-
diff --git a/lib/libdvd/patches/02-libdvdread_fix_symlinks_resolution_vfs.diff b/lib/libdvd/patches/02-libdvdread_fix_symlinks_resolution_vfs.diff
new file mode 100644
index 0000000000..30c66c3f4c
--- /dev/null
+++ b/lib/libdvd/patches/02-libdvdread_fix_symlinks_resolution_vfs.diff
@@ -0,0 +1,34 @@
+diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
+index d9544b3..f5ee550 100644
+--- a/lib/libdvd/libdvdread/src/dvd_reader.c
++++ b/lib/libdvd/libdvdread/src/dvd_reader.c
+@@ -429,10 +429,17 @@ dvd_reader_t *DVDOpen( const char *ppath )
+ /* Also WIN32 does not have symlinks, so we don't need this bit of code. */
+
+ /* Resolve any symlinks and get the absolute dir name. */
++#if defined(_XBMC) /* for XBMC, only do symlink resolution for (real) non-xbmc-VFS paths */
++ if ( path[0] == '/' )
++#endif // _XBMC
+ {
+ if( ( cdir = open( ".", O_RDONLY ) ) >= 0 ) {
+ if( chdir( path_copy ) == -1 ) {
++#if defined(_XBMC)
++ fprintf( stderr, "libdvdread: failed to change working directory to \"%s\": %s\n", path_copy, strerror(errno)); /* but ignore error */
++#else
+ goto DVDOpen_error;
++#endif // _XBMC
+ }
+ new_path = malloc(PATH_MAX+1);
+ if(!new_path) {
+@@ -445,7 +452,11 @@ dvd_reader_t *DVDOpen( const char *ppath )
+ close( cdir );
+ cdir = -1;
+ if( retval == -1 ) {
++#if defined(_XBMC)
++ fprintf( stderr, "libdvdread: failed to reset working directory to \".\": %s\n", strerror(errno)); /* but ignore error */
++#else
+ goto DVDOpen_error;
++#endif // _XBMC
+ }
+ path_copy = new_path;
+ new_path = NULL;