Skip to content

Commit 4fccfb2

Browse files
perminovVSminggo
authored andcommitted
[Win32] Fix AudioDecoder fopen unicode. (#17815)
If use fopen to need convert utf8 string FileUtils::getSuitableFOpen. ov_fopen and mpg123_open use fopen.
1 parent 9ed8968 commit 4fccfb2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cocos/audio/win32/AudioDecoderMp3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ namespace cocos2d { namespace experimental {
9191
break;
9292
}
9393

94-
if (mpg123_open(_mpg123handle, fullPath.c_str()) != MPG123_OK
94+
if (mpg123_open(_mpg123handle, FileUtils::getInstance()->getSuitableFOpen(fullPath).c_str()) != MPG123_OK
9595
|| mpg123_getformat(_mpg123handle, &rate, &channel, &mp3Encoding) != MPG123_OK)
9696
{
9797
ALOGE("Trouble with mpg123: %s\n", mpg123_strerror(_mpg123handle) );

cocos/audio/win32/AudioDecoderOgg.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace cocos2d { namespace experimental {
4242
bool AudioDecoderOgg::open(const char* path)
4343
{
4444
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(path);
45-
if (0 == ov_fopen(fullPath.c_str(), &_vf))
45+
if (0 == ov_fopen(FileUtils::getInstance()->getSuitableFOpen(fullPath).c_str(), &_vf))
4646
{
4747
// header
4848
vorbis_info* vi = ov_info(&_vf, -1);

0 commit comments

Comments
 (0)