Skip to content

Commit

Permalink
[xbmc][libdvdread] kodi VFS doesn't support opendir, use stat instead
Browse files Browse the repository at this point in the history
  • Loading branch information
Voyager1 committed Feb 20, 2016
1 parent 6b88581 commit 17d99db
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/dvd_reader.c
Expand Up @@ -692,6 +692,16 @@ static dvd_file_t *DVDOpenFileUDF( dvd_reader_t *dvd, const char *filename,
*/
static int findDirFile( const char *path, const char *file, char *filename )
{
#if defined(_XBMC)
struct stat fileinfo;

// no emulated opendir function in xbmc, so we'll
// check if the file exists by stat'ing it ...
sprintf(filename, "%s%s%s", path, ((path[strlen(path) - 1] == '/') ? "" : "/"), file);

if (stat(filename, &fileinfo) == 0) return 0;

#else
DIR *dir;
struct dirent *ent;

Expand All @@ -708,6 +718,7 @@ static int findDirFile( const char *path, const char *file, char *filename )
}
}
closedir(dir);
#endif // _XBMC
return -1;
}

Expand Down

0 comments on commit 17d99db

Please sign in to comment.