From 94cfc99d7b717bf38f38350d76d452ff55c4e0b5 Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Wed, 8 Aug 2012 20:58:06 +0000 Subject: [PATCH] - fixes #1044 - fixes to linux video player --- client/CConfigHandler.cpp | 5 ++++- client/CVideoHandler.cpp | 6 +++--- config/filesystem.json | 3 ++- lib/Filesystem/CFilesystemLoader.cpp | 4 ---- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/client/CConfigHandler.cpp b/client/CConfigHandler.cpp index befa92e9d..21eb56965 100644 --- a/client/CConfigHandler.cpp +++ b/client/CConfigHandler.cpp @@ -72,7 +72,10 @@ void SettingsStorage::invalidateNode(const std::vector &changedPath savedConf.Struct().erase("session"); savedConf.minimize(schema); - std::ofstream file((GVCMIDirs.UserPath + "/config/settings.json").c_str(), std::ofstream::trunc | std::ofstream::out); + + CResourceHandler::get()->createResource("CONFIG/settings.json"); + + std::ofstream file(CResourceHandler::get()->getResourceName(ResourceID("config/settings.json")), std::ofstream::trunc); file << savedConf; } diff --git a/client/CVideoHandler.cpp b/client/CVideoHandler.cpp index 09e859b18..dd80ecc3f 100644 --- a/client/CVideoHandler.cpp +++ b/client/CVideoHandler.cpp @@ -622,11 +622,11 @@ static si64 lod_seek(URLContext *context, si64 pos, int whence) { CVideoPlayer *video = (CVideoPlayer *)context->priv_data; - // Not sure what the parameter whence is. Assuming it always - // indicates an absolute value; + if (whence & AVSEEK_SIZE) + return video->length; + video->offset = pos; vstd::amin(video->offset, video->length); - return -1;//video->offset; } diff --git a/config/filesystem.json b/config/filesystem.json index e24413a23..6d6b8a01b 100644 --- a/config/filesystem.json +++ b/config/filesystem.json @@ -42,7 +42,8 @@ ], "CONFIG/": [ - {"type" : "dir", "path" : "ALL/Config", "writeable": true} + {"type" : "dir", "path" : "GLOBAL/Config",} // separate to avoid overwriting global resources + {"type" : "dir", "path" : "LOCAL/Config", "writeable": true} ], "MAPS/": [ diff --git a/lib/Filesystem/CFilesystemLoader.cpp b/lib/Filesystem/CFilesystemLoader.cpp index ad741183a..c5cdbfa5c 100644 --- a/lib/Filesystem/CFilesystemLoader.cpp +++ b/lib/Filesystem/CFilesystemLoader.cpp @@ -45,10 +45,6 @@ bool CFilesystemLoader::createEntry(std::string filename) if (fileList.find(res) != fileList.end()) return false; - std::ofstream file(baseDirectory + '/' + filename); - if (!file.good()) - return false; - fileList[res] = filename; return true; }