Skip to content

Commit

Permalink
Windows UWP: Fixes for recording/live TV playback (TSReader) via the …
Browse files Browse the repository at this point in the history
…vfs.smb2 plugin
  • Loading branch information
margro committed Sep 9, 2018
1 parent fdbed80 commit b731b39
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set(LIVE555_INCLUDE_DIR
src/lib/live555/
)

set(LIVE555_DEFINES -DLIVE555 -DSOCKLEN_T=socklen_t -DBSD=1)
set(LIVE555_DEFINES -DLIVE555 -D_WINSOCK_DEPRECATED_NO_WARNINGS -DSOCKLEN_T=socklen_t -DBSD=1)

include_directories(${kodiplatform_INCLUDE_DIRS}
${p8-platform_INCLUDE_DIRS}
Expand Down
13 changes: 9 additions & 4 deletions src/lib/tsreader/TSReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@ namespace MPTV
std::string CTsReader::TranslatePath(const char* pszFileName)
{
std::string sFileName = pszFileName;
#if defined (TARGET_WINDOWS)
#if defined (TARGET_WINDOWS_DESKTOP)
// Can we access the given file already?
if (OS::CFile::Exists(pszFileName))
{
KODI->Log(LOG_DEBUG, "Found the timeshift buffer at: %s\n", pszFileName);
return ToKodiPath(sFileName);
}
KODI->Log(LOG_NOTICE, "Cannot access '%s' directly. Assuming multiseat mode. Need to translate to UNC filename.", pszFileName);
#elif defined (TARGET_WINDOWS_STORE)
KODI->Log(LOG_DEBUG, "WindowsStore: need to translate '%s' to UNC filename.", pszFileName);
#else
KODI->Log(LOG_DEBUG, "Multiseat mode; need to translate '%s' to UNC filename.", pszFileName);
#endif
Expand Down Expand Up @@ -154,7 +156,7 @@ namespace MPTV
}
}

#if defined (TARGET_WINDOWS)
#if defined (TARGET_WINDOWS_DESKTOP)
// Can we now access the given file?
long errCode;
if (!OS::CFile::Exists(sFileName, &errCode))
Expand All @@ -166,7 +168,6 @@ namespace MPTV
break;
case ERROR_ACCESS_DENIED:
{
#ifdef TARGET_WINDOWS_DESKTOP
char strUserName[256];
DWORD lLength = 256;

Expand All @@ -175,7 +176,6 @@ namespace MPTV
KODI->Log(LOG_ERROR, "Access denied on %s. Check share access rights for user '%s' or connect as a different user using the Explorer.\n", sFileName.c_str(), strUserName);
}
else
#endif
{
KODI->Log(LOG_ERROR, "Access denied on %s. Check share access rights.\n", sFileName.c_str());
}
Expand All @@ -188,6 +188,11 @@ namespace MPTV

sFileName.clear();
}
#elif defined TARGET_WINDOWS_STORE
if (!KODI->FileExists(sFileName.c_str(), false))
{
KODI->Log(LOG_ERROR, "Cannot find or access file: %s. Did you enable the vfs.smb2 plugin?\n", sFileName.c_str());
}
#endif

return sFileName;
Expand Down

0 comments on commit b731b39

Please sign in to comment.