[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>xcode15
parent
4ec2146549
commit
660cb1bab1
|
@ -160,6 +160,22 @@ static void sidTuneLoader(const char *fileName, std::vector<uint8_t> &bufferRef)
|
||||||
|
|
||||||
@implementation SidDecoder
|
@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 {
|
- (BOOL)open:(id<CogSource>)s {
|
||||||
if(![s seekable])
|
if(![s seekable])
|
||||||
return NO;
|
return NO;
|
||||||
|
|
Loading…
Reference in New Issue