Fix AdPlug decoder.

CQTexperiment
Christopher Snowhill 2018-01-27 16:09:02 -08:00
parent 75bc139600
commit ea3ef1cadd
2 changed files with 16 additions and 4 deletions

View File

@ -33,9 +33,15 @@
[self setSource:s];
m_emu = new CNemuopl(44100);
NSString * path = [[s url] absoluteString];
NSRange fragmentRange = [path rangeOfString:@"#" options:NSBackwardsSearch];
if (fragmentRange.location != NSNotFound) {
path = [path substringToIndex:fragmentRange.location];
}
std::string path = [[[[source url] absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] UTF8String];
m_player = CAdPlug::factory(path, m_emu, CAdPlug::players, CProvider_cog( path, source ));
std::string _path = [[path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] UTF8String];
m_player = CAdPlug::factory(_path, m_emu, CAdPlug::players, CProvider_cog( _path, source ));
if ( !m_player )
return 0;

View File

@ -46,8 +46,14 @@
Copl * p_emu = new CSilentopl;
std::string path = [[[url absoluteString] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] UTF8String];
CPlayer * p_player = CAdPlug::factory(path, p_emu, CAdPlug::players, CProvider_cog( path, source ));
NSString * path = [url absoluteString];
NSRange fragmentRange = [path rangeOfString:@"#" options:NSBackwardsSearch];
if (fragmentRange.location != NSNotFound) {
path = [path substringToIndex:fragmentRange.location];
}
std::string _path = [[path stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding] UTF8String];
CPlayer * p_player = CAdPlug::factory(_path, p_emu, CAdPlug::players, CProvider_cog( _path, source ));
if ( !p_player )
{