[Audio Formats] Fix handling unsigned formats

This only affects the FFmpeg input, currently.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
swiftingly
Christopher Snowhill 2022-06-16 23:29:52 -07:00
parent 7044a9a852
commit 3e01312265
2 changed files with 5 additions and 5 deletions

View File

@ -56,11 +56,11 @@ AudioStreamBasicDescription propertiesToASBD(NSDictionary *properties)
asbd.mFormatFlags |= kLinearPCMFormatFlagIsAlignedHigh; asbd.mFormatFlags |= kLinearPCMFormatFlagIsAlignedHigh;
} }
if (isFloat == NO && [[properties objectForKey:@"Unsigned"] boolValue] == NO) { if(isFloat == NO && [[properties objectForKey:@"unSigned"] boolValue] == NO) {
asbd.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger; asbd.mFormatFlags |= kLinearPCMFormatFlagIsSignedInteger;
} }
if (isFloat) { if (isFloat) {
asbd.mFormatFlags |= kLinearPCMFormatFlagIsFloat | kAudioFormatFlagIsPacked; asbd.mFormatFlags |= kLinearPCMFormatFlagIsFloat | kAudioFormatFlagIsPacked;
} }

View File

@ -925,7 +925,7 @@ static uint8_t reverse_bits[0x100];
return @{ @"channels": [NSNumber numberWithInt:channels], return @{ @"channels": [NSNumber numberWithInt:channels],
@"channelConfig": [NSNumber numberWithUnsignedInt:channelConfig], @"channelConfig": [NSNumber numberWithUnsignedInt:channelConfig],
@"bitsPerSample": [NSNumber numberWithInt:bitsPerSample], @"bitsPerSample": [NSNumber numberWithInt:bitsPerSample],
@"Unsigned": [NSNumber numberWithBool:(bitsPerSample == 8)], @"unSigned": [NSNumber numberWithBool:(bitsPerSample == 8)],
@"sampleRate": [NSNumber numberWithFloat:frequency], @"sampleRate": [NSNumber numberWithFloat:frequency],
@"floatingPoint": [NSNumber numberWithBool:floatingPoint], @"floatingPoint": [NSNumber numberWithBool:floatingPoint],
@"totalFrames": [NSNumber numberWithDouble:totalFrames], @"totalFrames": [NSNumber numberWithDouble:totalFrames],