[SID Input] Add static initializer for residfp
The SID builder needs a static initializer, otherwise multiple instances created simultaneously, such as during populating info on adding a lot of tracks, will race and crash the player. Signed-off-by: Christopher Snowhill <kode54@gmail.com>main
parent
3ff9d079d7
commit
b60a5462b7
|
@ -160,6 +160,22 @@ static void sidTuneLoader(const char *fileName, std::vector<uint8_t> &bufferRef)
|
|||
|
||||
@implementation SidDecoder
|
||||
|
||||
// Need this static initializer to create the static global tables that sidplayfp doesn't really lock access to
|
||||
+ (void)initialize {
|
||||
ReSIDfpBuilder *builder = new ReSIDfpBuilder("ReSIDfp");
|
||||
|
||||
if(builder) {
|
||||
builder->create(1);
|
||||
if(builder->getStatus()) {
|
||||
builder->filter(true);
|
||||
builder->filter6581Curve(0.5);
|
||||
builder->filter8580Curve(0.5);
|
||||
}
|
||||
|
||||
delete builder;
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)open:(id<CogSource>)s {
|
||||
if(![s seekable])
|
||||
return NO;
|
||||
|
|
Loading…
Reference in New Issue