Browse Source

Fix AdPlug decoder.

master
Christopher Snowhill 2 years ago
parent
commit
ce1d938b3a
2 changed files with 16 additions and 4 deletions
  1. +8
    -2
      Plugins/AdPlug/AdPlug/AdPlugDecoder.mm
  2. +8
    -2
      Plugins/AdPlug/AdPlug/AdPlugMetadataReader.mm

+ 8
- 2
Plugins/AdPlug/AdPlug/AdPlugDecoder.mm 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;


+ 8
- 2
Plugins/AdPlug/AdPlug/AdPlugMetadataReader.mm 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 )
{


Loading…
Cancel
Save