diff --git a/MP42/MP42AC3AudioEncoder.m b/MP42/MP42AC3AudioEncoder.m index 0cade45..b13d582 100644 --- a/MP42/MP42AC3AudioEncoder.m +++ b/MP42/MP42AC3AudioEncoder.m @@ -52,7 +52,7 @@ typedef struct AudioFileIO @property (nonatomic, readonly) NSUInteger bitrate; -@property (nonatomic, readonly) NSThread *decoderThread; +@property (nonatomic, readonly) NSThread *thread; @property (nonatomic, readonly) MP42Fifo *inputSamplesBuffer; @property (nonatomic, readonly) MP42Fifo *outputSamplesBuffer; @@ -257,9 +257,9 @@ typedef struct AudioFileIO - (void)start { - _decoderThread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainRoutine) object:nil]; - [_decoderThread setName:@"AudioToolbox Audio Encoder"]; - [_decoderThread start]; + _thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainRoutine) object:nil]; + [_thread setName:@"FFmpeg Audio Encoder"]; + [_thread start]; } #pragma mark - Public methods diff --git a/MP42/MP42AVFImporter.m b/MP42/MP42AVFImporter.m index cbbf2fa..58957ff 100644 --- a/MP42/MP42AVFImporter.m +++ b/MP42/MP42AVFImporter.m @@ -384,13 +384,25 @@ - (NSString *)stringFromArray:(NSArray *)array key:(id)key { NSMutableString *result = [NSMutableString string]; - for (NSDictionary *name in array) { + if ([array isKindOfClass:[NSArray class]]) { - if (result.length) { - [result appendString:@", "]; + for (id name in array) { + + if (result.length) { + [result appendString:@", "]; + } + + if ([name isKindOfClass:[NSDictionary class]]) { + [result appendString:name[key]]; + } + else if ([name isKindOfClass:[NSString class]]) { + [result appendString:name]; + } } - - [result appendString:name[key]]; + } + else if ([array isKindOfClass:[NSString class]]) { + NSString *name = (NSString *)array; + [result appendString:name]; } return [[result copy] autorelease]; diff --git a/MP42/MP42AudioEncoder.m b/MP42/MP42AudioEncoder.m index 68a9a04..a3f8f52 100644 --- a/MP42/MP42AudioEncoder.m +++ b/MP42/MP42AudioEncoder.m @@ -48,7 +48,7 @@ typedef struct AudioFileIO @property (nonatomic, readonly) AudioConverterRef encoder; @property (nonatomic, readonly) NSUInteger bitrate; -@property (nonatomic, readonly) NSThread *decoderThread; +@property (nonatomic, readonly) NSThread *thread; @property (nonatomic, readonly) MP42Fifo *inputSamplesBuffer; @property (nonatomic, readonly) MP42Fifo *outputSamplesBuffer; @@ -291,9 +291,9 @@ typedef struct AudioFileIO - (void)start { - _decoderThread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainRoutine) object:nil]; - [_decoderThread setName:@"AudioToolbox Audio Encoder"]; - [_decoderThread start]; + _thread = [[NSThread alloc] initWithTarget:self selector:@selector(threadMainRoutine) object:nil]; + [_thread setName:@"AudioToolbox Audio Encoder"]; + [_thread start]; } #pragma mark - Public methods diff --git a/MP42/MP42Metadata.m b/MP42/MP42Metadata.m index 55ab828..68b914b 100644 --- a/MP42/MP42Metadata.m +++ b/MP42/MP42Metadata.m @@ -324,8 +324,16 @@ - (NSMutableArray *)stringArrayFromDictionaryArray:(NSArray *)array key:(id)key { NSMutableArray *result = [NSMutableArray array]; - for (NSDictionary *name in array) { - [result addObject:name[key]]; + if ([array isKindOfClass:[NSArray class]]) { + for (NSDictionary *dict in array) { + if ([dict isKindOfClass:[NSDictionary class]]) { + [result addObject:dict[key]]; + } + } + } + else if ([array isKindOfClass:[NSString class]]) { + NSString *name = (NSString *)array; + [result addObject:name]; } return [result copy]; diff --git a/contrib b/contrib index e9270b2..b6bb6e0 160000 --- a/contrib +++ b/contrib @@ -1 +1 @@ -Subproject commit e9270b2f75f196d55caba457d9190cc752227bb3 +Subproject commit b6bb6e02ca5641b5ee0613e0e355ab36844eb208