Skip to content
This repository
Browse code

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 authored May 13, 2013
3  lib/libdvd/libdvdread/src/dvd_reader.c
@@ -429,6 +429,9 @@ dvd_reader_t *DVDOpen( const char *ppath )
429 429
               /* Also WIN32 does not have symlinks, so we don't need this bit of code. */
430 430
 
431 431
     /* Resolve any symlinks and get the absolute dir name. */
  432
+#if defined(_XBMC) /* for XBMC, only do symlink resolution for (real) non-xbmc-VFS paths */
  433
+	if ( path[0] == '/' )
  434
+#endif // _XBMC
432 435
 	{
433 436
       if( ( cdir  = open( ".", O_RDONLY ) ) >= 0 ) {
434 437
         if( chdir( path_copy ) == -1 ) {
87  lib/libdvd/patches/02-libdvdread_dvd_reader.c.diff
... ...
@@ -1,87 +0,0 @@
1  
-From 3708d886958258fcf18fe827eb8ab32ecda45943 Mon Sep 17 00:00:00 2001
2  
-From: Voyager1 <voyager@xbmc.org>
3  
-Date: Wed, 20 Feb 2013 19:47:34 +0100
4  
-Subject: [PATCH 1/3] Fix inability of libdvd 4.2.0 to read DVDs stored as
5  
- VIDEO_TS files on non-Windows OSs. Fixes
6  
- http://trac.xbmc.org/ticket/14115.
7  
-
8  
----
9  
- lib/libdvd/libdvdread/src/dvd_reader.c |    4 ++++
10  
- 1 file changed, 4 insertions(+)
11  
-
12  
-diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
13  
-index d9544b3..2b3562f 100644
14  
---- a/lib/libdvd/libdvdread/src/dvd_reader.c
15  
-+++ b/lib/libdvd/libdvdread/src/dvd_reader.c
16  
-@@ -445,7 +445,11 @@ dvd_reader_t *DVDOpen( const char *ppath )
17  
- 		close( cdir );
18  
-         cdir = -1;
19  
-         if( retval == -1 ) {
20  
-+#if defined(_XBMC)
21  
-+          perror("libdvdread: failed to reset working directory to \".\""); /* but ignore error */
22  
-+#else
23  
-           goto DVDOpen_error;
24  
-+#endif // _XBMC
25  
-         }
26  
- 		    path_copy = new_path;
27  
-         new_path = NULL;
28  
--- 
29  
-1.7.9.4
30  
-
31  
-From cffa18401f642b35a91de7e5b1e184f1dc0bef6d Mon Sep 17 00:00:00 2001
32  
-From: Voyager1 <voyager@xbmc.org>
33  
-Date: Thu, 21 Feb 2013 20:07:03 +0100
34  
-Subject: [PATCH 2/3] libdvdread: replace perror by fprintf so that it gets
35  
- picked up in xbmc logs
36  
-
37  
----
38  
- lib/libdvd/libdvdread/src/dvd_reader.c |    2 +-
39  
- 1 file changed, 1 insertion(+), 1 deletion(-)
40  
-
41  
-diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
42  
-index 2b3562f..38a3812 100644
43  
---- a/lib/libdvd/libdvdread/src/dvd_reader.c
44  
-+++ b/lib/libdvd/libdvdread/src/dvd_reader.c
45  
-@@ -446,7 +446,7 @@ dvd_reader_t *DVDOpen( const char *ppath )
46  
-         cdir = -1;
47  
-         if( retval == -1 ) {
48  
- #if defined(_XBMC)
49  
--          perror("libdvdread: failed to reset working directory to \".\""); /* but ignore error */
50  
-+          fprintf( stderr, "libdvdread: failed to reset working directory to \".\": %s\n", strerror(errno)); /* but ignore error */
51  
- #else
52  
-           goto DVDOpen_error;
53  
- #endif // _XBMC
54  
--- 
55  
-1.7.9.4
56  
-
57  
-From cb345a7e3cde07506bf3a2d696fcbb3dff44477d Mon Sep 17 00:00:00 2001
58  
-From: Memphiz <memphis@machzwo.de>
59  
-Date: Sat, 20 Apr 2013 01:04:53 +0200
60  
-Subject: [PATCH 3/3] [dvdread] - don't check the return value of chdir in
61  
- xbmc - this function is not wrapped and might fail (and
62  
- so will the whole dvd open in that case). This is non
63  
- fatal for our vfs!
64  
-
65  
----
66  
- lib/libdvd/libdvdread/src/dvd_reader.c |    4 ++++
67  
- 1 file changed, 4 insertions(+)
68  
-
69  
-diff --git a/lib/libdvd/libdvdread/src/dvd_reader.c b/lib/libdvd/libdvdread/src/dvd_reader.c
70  
-index 38a3812..d7ff12e 100644
71  
---- a/lib/libdvd/libdvdread/src/dvd_reader.c
72  
-+++ b/lib/libdvd/libdvdread/src/dvd_reader.c
73  
-@@ -432,7 +432,11 @@ dvd_reader_t *DVDOpen( const char *ppath )
74  
- 	{
75  
-       if( ( cdir  = open( ".", O_RDONLY ) ) >= 0 ) {
76  
-         if( chdir( path_copy ) == -1 ) {
77  
-+#if defined(_XBMC)
78  
-+          fprintf( stderr, "libdvdread: failed to change working directory to \"%s\": %s\n", path_copy, strerror(errno)); /* but ignore error */
79  
-+#else
80  
-           goto DVDOpen_error;
81  
-+#endif // _XBMC
82  
-         }
83  
- 		new_path = malloc(PATH_MAX+1);
84  
- 		if(!new_path) {
85  
--- 
86  
-1.7.9.4
87  
-
34  lib/libdvd/patches/02-libdvdread_fix_symlinks_resolution_vfs.diff
... ...
@@ -0,0 +1,34 @@

0 notes on commit d38b14e

Please sign in to comment.
Something went wrong with that request. Please try again.