Skip to content

Commit

Permalink
[libdvd] - added missing patches
Browse files Browse the repository at this point in the history
  • Loading branch information
Memphiz committed Apr 21, 2013
1 parent a894e5e commit 217532d
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
File renamed without changes.
87 changes: 87 additions & 0 deletions lib/libdvd/patches/02-libdvdread_dvd_reader.c.diff
@@ -0,0 +1,87 @@
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

0 comments on commit 217532d

Please sign in to comment.