{"action":"created","comment":{"url":"https://api.github.com/repos/scummvm/scummvm/pulls/comments/58310253","id":58310253,"diff_hunk":"@@ -100,15 +100,14 @@ BaseSoundBuffer *BaseSoundMgr::addSound(const Common::String &filename, Audio::M\n \tBaseSoundBuffer *sound;\n \n \tCommon::String useFilename = filename;\n+\tuseFilename.toLowercase();\n \t// try to switch WAV to OGG file (if available)\n-\tAnsiString ext = PathUtil::getExtension(filename);\n-\tif (StringUtil::compareNoCase(ext, \"wav\")) {\n-\t\tAnsiString path = PathUtil::getDirectoryName(filename);\n-\t\tAnsiString name = PathUtil::getFileNameWithoutExtension(filename);\n-\n-\t\tAnsiString newFile = PathUtil::combine(path, name + \"ogg\");\n-\t\tif (BaseFileManager::getEngineInstance()->hasFile(newFile)) {\n-\t\t\tuseFilename = newFile;\n+\tif (useFilename.hasSuffix(\".wav\")) {\n+\t\tCommon::String oggFilename = useFilename;\n+\t\toggFilename.erase(oggFilename.size() - 4);\n+\t\toggFilename = oggFilename + \".ogg\";","path":"engines/wintermute/base/sound/base_sound_manager.cpp","position":17,"original_position":17,"commit_id":"0cfd0589432798838b66023b01a5ca6ba4fad0ca","original_commit_id":"0cfd0589432798838b66023b01a5ca6ba4fad0ca","user":{"login":"tobiatesan","id":4173813,"avatar_url":"https://avatars.githubusercontent.com/u/4173813?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiatesan","html_url":"https://github.com/tobiatesan","followers_url":"https://api.github.com/users/tobiatesan/followers","following_url":"https://api.github.com/users/tobiatesan/following{/other_user}","gists_url":"https://api.github.com/users/tobiatesan/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiatesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiatesan/subscriptions","organizations_url":"https://api.github.com/users/tobiatesan/orgs","repos_url":"https://api.github.com/users/tobiatesan/repos","events_url":"https://api.github.com/users/tobiatesan/events{/privacy}","received_events_url":"https://api.github.com/users/tobiatesan/received_events","type":"User","site_admin":false},"body":"(Okay, `n` extra chars where `n` is at most the number of sounds in that scene).","created_at":"2016-04-03T13:25:29Z","updated_at":"2016-04-03T13:25:29Z","html_url":"https://github.com/scummvm/scummvm/pull/728#discussion_r58310253","pull_request_url":"https://api.github.com/repos/scummvm/scummvm/pulls/728","_links":{"self":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/comments/58310253"},"html":{"href":"https://github.com/scummvm/scummvm/pull/728#discussion_r58310253"},"pull_request":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/728"}}},"pull_request":{"url":"https://api.github.com/repos/scummvm/scummvm/pulls/728","id":64266882,"html_url":"https://github.com/scummvm/scummvm/pull/728","diff_url":"https://github.com/scummvm/scummvm/pull/728.diff","patch_url":"https://github.com/scummvm/scummvm/pull/728.patch","issue_url":"https://api.github.com/repos/scummvm/scummvm/issues/728","number":728,"state":"open","locked":false,"title":"WINTERMUTE: Correctly find .ogg version of .wav files","user":{"login":"tobiatesan","id":4173813,"avatar_url":"https://avatars.githubusercontent.com/u/4173813?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiatesan","html_url":"https://github.com/tobiatesan","followers_url":"https://api.github.com/users/tobiatesan/followers","following_url":"https://api.github.com/users/tobiatesan/following{/other_user}","gists_url":"https://api.github.com/users/tobiatesan/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiatesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiatesan/subscriptions","organizations_url":"https://api.github.com/users/tobiatesan/orgs","repos_url":"https://api.github.com/users/tobiatesan/repos","events_url":"https://api.github.com/users/tobiatesan/events{/privacy}","received_events_url":"https://api.github.com/users/tobiatesan/received_events","type":"User","site_admin":false},"body":"As it was, it didn't work because it turned\r\n\"some\\\\windows\\\\path.wav\" into \"some/system/pathogg\" (not \".ogg\"), so any file called by the scripts with its \".wav\" extension but actually present in compressed .ogg form on the .dcp archive could not be found.\r\n\r\nbase_disk_file.cpp (apparently) takes care of preprocessing the path to make it system-agnostic already for those files which reside on the disk.\r\n\r\nThis one should fix https://sourceforge.net/p/scummvm/bugs/7088/\r\n\r\nThe corresponding bit in the original engine is:\r\n\r\n```\r\n\t// try to switch WAV to OGG file (if available)\r\n\t_splitpath(Filename, drive, dir, fname, ext);\r\n\tif(_stricmp(ext, \".WAV\")==0){\r\n\t\t_makepath(NewFile, drive, dir, fname, \".OGG\");\r\n\t\tCBFile* file = Game->m_FileManager->OpenFile(NewFile);\r\n\t\tif(file){\r\n\t\t\tFilename = NewFile;\r\n\t\t\tGame->m_FileManager->CloseFile(file);\r\n\t\t}\r\n\t}\r\n\r\n```\r\n\r\nThis way it should work reliably on all platforms like this, but just to be sure I would love it if somebody who runs Windows would check it before merging (I won't probably be able to do it before tomorrow).","created_at":"2016-03-27T14:32:22Z","updated_at":"2016-04-03T13:25:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27314a1f79173a5e23f82414b2cce40e67852acb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scummvm/scummvm/pulls/728/commits","review_comments_url":"https://api.github.com/repos/scummvm/scummvm/pulls/728/comments","review_comment_url":"https://api.github.com/repos/scummvm/scummvm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scummvm/scummvm/issues/728/comments","statuses_url":"https://api.github.com/repos/scummvm/scummvm/statuses/0cfd0589432798838b66023b01a5ca6ba4fad0ca","head":{"label":"tobiatesan:fix_ogg","ref":"fix_ogg","sha":"0cfd0589432798838b66023b01a5ca6ba4fad0ca","user":{"login":"tobiatesan","id":4173813,"avatar_url":"https://avatars.githubusercontent.com/u/4173813?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiatesan","html_url":"https://github.com/tobiatesan","followers_url":"https://api.github.com/users/tobiatesan/followers","following_url":"https://api.github.com/users/tobiatesan/following{/other_user}","gists_url":"https://api.github.com/users/tobiatesan/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiatesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiatesan/subscriptions","organizations_url":"https://api.github.com/users/tobiatesan/orgs","repos_url":"https://api.github.com/users/tobiatesan/repos","events_url":"https://api.github.com/users/tobiatesan/events{/privacy}","received_events_url":"https://api.github.com/users/tobiatesan/received_events","type":"User","site_admin":false},"repo":{"id":9481352,"name":"scummvm","full_name":"tobiatesan/scummvm","owner":{"login":"tobiatesan","id":4173813,"avatar_url":"https://avatars.githubusercontent.com/u/4173813?v=3","gravatar_id":"","url":"https://api.github.com/users/tobiatesan","html_url":"https://github.com/tobiatesan","followers_url":"https://api.github.com/users/tobiatesan/followers","following_url":"https://api.github.com/users/tobiatesan/following{/other_user}","gists_url":"https://api.github.com/users/tobiatesan/gists{/gist_id}","starred_url":"https://api.github.com/users/tobiatesan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobiatesan/subscriptions","organizations_url":"https://api.github.com/users/tobiatesan/orgs","repos_url":"https://api.github.com/users/tobiatesan/repos","events_url":"https://api.github.com/users/tobiatesan/events{/privacy}","received_events_url":"https://api.github.com/users/tobiatesan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tobiatesan/scummvm","description":"ScummVM main repository","fork":true,"url":"https://api.github.com/repos/tobiatesan/scummvm","forks_url":"https://api.github.com/repos/tobiatesan/scummvm/forks","keys_url":"https://api.github.com/repos/tobiatesan/scummvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tobiatesan/scummvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tobiatesan/scummvm/teams","hooks_url":"https://api.github.com/repos/tobiatesan/scummvm/hooks","issue_events_url":"https://api.github.com/repos/tobiatesan/scummvm/issues/events{/number}","events_url":"https://api.github.com/repos/tobiatesan/scummvm/events","assignees_url":"https://api.github.com/repos/tobiatesan/scummvm/assignees{/user}","branches_url":"https://api.github.com/repos/tobiatesan/scummvm/branches{/branch}","tags_url":"https://api.github.com/repos/tobiatesan/scummvm/tags","blobs_url":"https://api.github.com/repos/tobiatesan/scummvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tobiatesan/scummvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tobiatesan/scummvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/tobiatesan/scummvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tobiatesan/scummvm/statuses/{sha}","languages_url":"https://api.github.com/repos/tobiatesan/scummvm/languages","stargazers_url":"https://api.github.com/repos/tobiatesan/scummvm/stargazers","contributors_url":"https://api.github.com/repos/tobiatesan/scummvm/contributors","subscribers_url":"https://api.github.com/repos/tobiatesan/scummvm/subscribers","subscription_url":"https://api.github.com/repos/tobiatesan/scummvm/subscription","commits_url":"https://api.github.com/repos/tobiatesan/scummvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/tobiatesan/scummvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/tobiatesan/scummvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/tobiatesan/scummvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/tobiatesan/scummvm/contents/{+path}","compare_url":"https://api.github.com/repos/tobiatesan/scummvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tobiatesan/scummvm/merges","archive_url":"https://api.github.com/repos/tobiatesan/scummvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tobiatesan/scummvm/downloads","issues_url":"https://api.github.com/repos/tobiatesan/scummvm/issues{/number}","pulls_url":"https://api.github.com/repos/tobiatesan/scummvm/pulls{/number}","milestones_url":"https://api.github.com/repos/tobiatesan/scummvm/milestones{/number}","notifications_url":"https://api.github.com/repos/tobiatesan/scummvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tobiatesan/scummvm/labels{/name}","releases_url":"https://api.github.com/repos/tobiatesan/scummvm/releases{/id}","deployments_url":"https://api.github.com/repos/tobiatesan/scummvm/deployments","created_at":"2013-04-16T20:01:14Z","updated_at":"2014-09-01T15:55:56Z","pushed_at":"2016-04-03T08:47:45Z","git_url":"git://github.com/tobiatesan/scummvm.git","ssh_url":"git@github.com:tobiatesan/scummvm.git","clone_url":"https://github.com/tobiatesan/scummvm.git","svn_url":"https://github.com/tobiatesan/scummvm","homepage":"http://www.scummvm.org/","size":198139,"stargazers_count":1,"watchers_count":1,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"scummvm:master","ref":"master","sha":"244e143e61678d1adb19f2864cec34f868aaf44e","user":{"login":"scummvm","id":365181,"avatar_url":"https://avatars.githubusercontent.com/u/365181?v=3","gravatar_id":"","url":"https://api.github.com/users/scummvm","html_url":"https://github.com/scummvm","followers_url":"https://api.github.com/users/scummvm/followers","following_url":"https://api.github.com/users/scummvm/following{/other_user}","gists_url":"https://api.github.com/users/scummvm/gists{/gist_id}","starred_url":"https://api.github.com/users/scummvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scummvm/subscriptions","organizations_url":"https://api.github.com/users/scummvm/orgs","repos_url":"https://api.github.com/users/scummvm/repos","events_url":"https://api.github.com/users/scummvm/events{/privacy}","received_events_url":"https://api.github.com/users/scummvm/received_events","type":"Organization","site_admin":false},"repo":{"id":1358940,"name":"scummvm","full_name":"scummvm/scummvm","owner":{"login":"scummvm","id":365181,"avatar_url":"https://avatars.githubusercontent.com/u/365181?v=3","gravatar_id":"","url":"https://api.github.com/users/scummvm","html_url":"https://github.com/scummvm","followers_url":"https://api.github.com/users/scummvm/followers","following_url":"https://api.github.com/users/scummvm/following{/other_user}","gists_url":"https://api.github.com/users/scummvm/gists{/gist_id}","starred_url":"https://api.github.com/users/scummvm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scummvm/subscriptions","organizations_url":"https://api.github.com/users/scummvm/orgs","repos_url":"https://api.github.com/users/scummvm/repos","events_url":"https://api.github.com/users/scummvm/events{/privacy}","received_events_url":"https://api.github.com/users/scummvm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scummvm/scummvm","description":"ScummVM main repository","fork":false,"url":"https://api.github.com/repos/scummvm/scummvm","forks_url":"https://api.github.com/repos/scummvm/scummvm/forks","keys_url":"https://api.github.com/repos/scummvm/scummvm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scummvm/scummvm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scummvm/scummvm/teams","hooks_url":"https://api.github.com/repos/scummvm/scummvm/hooks","issue_events_url":"https://api.github.com/repos/scummvm/scummvm/issues/events{/number}","events_url":"https://api.github.com/repos/scummvm/scummvm/events","assignees_url":"https://api.github.com/repos/scummvm/scummvm/assignees{/user}","branches_url":"https://api.github.com/repos/scummvm/scummvm/branches{/branch}","tags_url":"https://api.github.com/repos/scummvm/scummvm/tags","blobs_url":"https://api.github.com/repos/scummvm/scummvm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scummvm/scummvm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scummvm/scummvm/git/refs{/sha}","trees_url":"https://api.github.com/repos/scummvm/scummvm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scummvm/scummvm/statuses/{sha}","languages_url":"https://api.github.com/repos/scummvm/scummvm/languages","stargazers_url":"https://api.github.com/repos/scummvm/scummvm/stargazers","contributors_url":"https://api.github.com/repos/scummvm/scummvm/contributors","subscribers_url":"https://api.github.com/repos/scummvm/scummvm/subscribers","subscription_url":"https://api.github.com/repos/scummvm/scummvm/subscription","commits_url":"https://api.github.com/repos/scummvm/scummvm/commits{/sha}","git_commits_url":"https://api.github.com/repos/scummvm/scummvm/git/commits{/sha}","comments_url":"https://api.github.com/repos/scummvm/scummvm/comments{/number}","issue_comment_url":"https://api.github.com/repos/scummvm/scummvm/issues/comments{/number}","contents_url":"https://api.github.com/repos/scummvm/scummvm/contents/{+path}","compare_url":"https://api.github.com/repos/scummvm/scummvm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scummvm/scummvm/merges","archive_url":"https://api.github.com/repos/scummvm/scummvm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scummvm/scummvm/downloads","issues_url":"https://api.github.com/repos/scummvm/scummvm/issues{/number}","pulls_url":"https://api.github.com/repos/scummvm/scummvm/pulls{/number}","milestones_url":"https://api.github.com/repos/scummvm/scummvm/milestones{/number}","notifications_url":"https://api.github.com/repos/scummvm/scummvm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scummvm/scummvm/labels{/name}","releases_url":"https://api.github.com/repos/scummvm/scummvm/releases{/id}","deployments_url":"https://api.github.com/repos/scummvm/scummvm/deployments","created_at":"2011-02-12T15:50:57Z","updated_at":"2016-04-02T18:34:23Z","pushed_at":"2016-04-03T13:17:07Z","git_url":"git://github.com/scummvm/scummvm.git","ssh_url":"git@github.com:scummvm/scummvm.git","clone_url":"https://github.com/scummvm/scummvm.git","svn_url":"https://github.com/scummvm/scummvm","homepage":"http://www.scummvm.org/","size":224060,"stargazers_count":597,"watchers_count":597,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":315,"mirror_url":null,"open_issues_count":33,"forks":315,"open_issues":33,"watchers":597,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/728"},"html":{"href":"https://github.com/scummvm/scummvm/pull/728"},"issue":{"href":"https://api.github.com/repos/scummvm/scummvm/issues/728"},"comments":{"href":"https://api.github.com/repos/scummvm/scummvm/issues/728/comments"},"review_comments":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/728/comments"},"review_comment":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scummvm/scummvm/pulls/728/commits"},"statuses":{"href":"https://api.github.com/repos/scummvm/scummvm/statuses/0cfd0589432798838b66023b01a5ca6ba4fad0ca"}}}}