Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2723 from Voyager1/libdvdread-fix

Libdvdread fix for SMB, NFS, VIDEO_TS files (non-Windows platforms). fixes #14316
  • Loading branch information...
commit d38b14e8e53dca4bb6d90b536aef3e8dcb374f95 2 parents 846ccff + 56b4e56
@Voyager1 Voyager1 authored
View
3  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 ) {
View
87 lib/libdvd/patches/02-libdvdread_dvd_reader.c.diff
@@ -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
-
View
34 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;
Please sign in to comment.
Something went wrong with that request. Please try again.