From cb8fb9ce870ddb401ef3aa06800b73c14895590b Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Fri, 8 Nov 2019 15:04:43 -0800 Subject: [PATCH] Fix VGM parsing so it doesn't hit the other two registered VGM container handlers --- Plugins/GME/GameContainer.m | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Plugins/GME/GameContainer.m b/Plugins/GME/GameContainer.m index e6930c73f..28458b2c6 100755 --- a/Plugins/GME/GameContainer.m +++ b/Plugins/GME/GameContainer.m @@ -18,7 +18,9 @@ + (NSArray *)fileTypes { //There doesn't seem to be a way to get this list. These are the only multitrack types. - return [NSArray arrayWithObjects:@"ay", @"gbs", @"hes", @"kss", @"nsf", @"nsfe", @"sap", @"sgc", nil]; + return [NSArray arrayWithObjects:@"ay", @"gbs", @"hes", @"kss", @"nsf", @"nsfe", @"sap", @"sgc", + @"vgm",@"vgz", // These are included so they can override AdPlug + nil]; } + (NSArray *)mimeTypes @@ -38,6 +40,14 @@ // input url already has fragment defined - no need to expand further return [NSMutableArray arrayWithObject:url]; } + + // Dodge both VGMStream and AdPlug + NSString * extension = [url pathExtension]; + if (extension && ([extension caseInsensitiveCompare:@"vgm"] == NSOrderedSame || + [extension caseInsensitiveCompare:@"vgz"] == NSOrderedSame)) + { + return [NSMutableArray arrayWithObject:[NSURL URLWithString:[[url absoluteString] stringByAppendingString:@"#0"]]]; + } id audioSourceClass = NSClassFromString(@"AudioSource"); id source = [audioSourceClass audioSourceForURL:url];