if ([track[@"AudioSamplerate"] isKindOfClass:[NSString class]])
{
newTrack.sampleRate = hb_audio_samplerate_get_from_name([track[@"AudioSamplerate"] UTF8String]);
+
+ // Set to "Auto" if we didn't find a valid sample rate.
+ if (newTrack.sampleRate == -1)
+ {
+ newTrack.sampleRate = 0;
+ }
}
newTrack.bitRate = [track[@"AudioBitrate"] intValue];
- (id)reverseTransformedValue:(id)value
{
- return @(hb_audio_samplerate_get_from_name([value UTF8String]));
+ int sampleRate = hb_audio_samplerate_get_from_name([value UTF8String]);
+ if (sampleRate < 0)
+ {
+ sampleRate = 0;
+ }
+ return @(sampleRate);
}
@end