Skip to content
This repository
Browse code

Merge pull request #2753 from Voyager1/libdvdread-fix

Better Libdvdread fix for SMB/NFS VIDEO_TS dvd files (non-Windows and now including Android) with special thanks to @theuni !
  • Loading branch information...
commit 86b587baf43a930cc02a6d9ec0a4cc88816facd4 2 parents c2debe6 + 7401bbf
Voyager1 authored May 15, 2013
14  lib/libdvd/libdvdread/src/dvd_reader.c
@@ -425,21 +425,15 @@ dvd_reader_t *DVDOpen( const char *ppath )
425 425
     if( !(path_copy = strdup( path ) ) )
426 426
       goto DVDOpen_error;
427 427
 
428  
-#ifndef WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
  428
+#if !defined(WIN32) && !defined(_XBMC) /* don't have fchdir, and getcwd( NULL, ... ) is strange */
429 429
               /* Also WIN32 does not have symlinks, so we don't need this bit of code. */
  430
+			  /* XBMC also doesn't need symlink resolution */
430 431
 
431 432
     /* 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
435 433
 	{
436 434
       if( ( cdir  = open( ".", O_RDONLY ) ) >= 0 ) {
437 435
         if( chdir( path_copy ) == -1 ) {
438  
-#if defined(_XBMC)
439  
-          fprintf( stderr, "libdvdread: failed to change working directory to \"%s\": %s\n", path_copy, strerror(errno)); /* but ignore error */
440  
-#else
441 436
           goto DVDOpen_error;
442  
-#endif // _XBMC
443 437
         }
444 438
 		new_path = malloc(PATH_MAX+1);
445 439
 		if(!new_path) {
@@ -452,11 +446,7 @@ dvd_reader_t *DVDOpen( const char *ppath )
452 446
 		close( cdir );
453 447
         cdir = -1;
454 448
         if( retval == -1 ) {
455  
-#if defined(_XBMC)
456  
-          fprintf( stderr, "libdvdread: failed to reset working directory to \".\": %s\n", strerror(errno)); /* but ignore error */
457  
-#else
458 449
           goto DVDOpen_error;
459  
-#endif // _XBMC
460 450
         }
461 451
 		    path_copy = new_path;
462 452
         new_path = NULL;
35  lib/libdvd/patches/02-libdvdread_fix_symlinks_resolution_vfs.diff
... ...
@@ -1,34 +1,15 @@
5  xbmc/cores/DllLoader/exports/wrapper.c
@@ -405,6 +405,11 @@ int __wrap__stat(const char *path, struct _stat *buffer)
405 405
   return dll_stat(path, buffer);
406 406
 }
407 407
 
  408
+int __wrap_stat(const char *path, struct _stat *buffer)
  409
+{
  410
+  return dll_stat(path, buffer);
  411
+}
  412
+
408 413
 int __wrap___xstat64(int __ver, const char *__filename, struct stat64 *__stat_buf)
409 414
 {
410 415
   return dll_stat64(__filename, __stat_buf);

0 notes on commit 86b587b

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