1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00
- fixes to linux video player
This commit is contained in:
Ivan Savenko 2012-08-08 20:58:06 +00:00
parent 127600311f
commit 94cfc99d7b
4 changed files with 9 additions and 9 deletions

View File

@ -72,7 +72,10 @@ void SettingsStorage::invalidateNode(const std::vector<std::string> &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;
}

View File

@ -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;
}

View File

@ -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/":
[

View File

@ -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;
}