diff options
-rw-r--r-- | macosx/HBCodingUtilities.h | 2 | ||||
-rw-r--r-- | macosx/HBSubtitles.m | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/macosx/HBCodingUtilities.h b/macosx/HBCodingUtilities.h index de50bfaf7..17d188b7f 100644 --- a/macosx/HBCodingUtilities.h +++ b/macosx/HBCodingUtilities.h @@ -21,6 +21,8 @@ #define decodeCollectionOfObjects(x, cl, objectcl) x = [HBCodingUtilities decodeObjectOfClasses:[NSSet setWithObjects:[cl class], [objectcl class], nil] forKey:OBJC_STRINGIFY(x) decoder:decoder]; +#define decodeCollectionOfObjects2(x, cl, objectcl, objectcl2) x = [HBCodingUtilities decodeObjectOfClasses:[NSSet setWithObjects:[cl class], [objectcl class], [objectcl2 class], nil] forKey:OBJC_STRINGIFY(x) decoder:decoder]; + #define decodeObjectOrFail(x, class) x = [HBCodingUtilities decodeObjectOfClass:class forKey:OBJC_STRINGIFY(x) decoder:decoder]; if (x == nil) {NSLog(@"Failed to decode: %@", OBJC_STRINGIFY(x)); goto fail;} NS_ASSUME_NONNULL_BEGIN diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m index f1a31174b..c98f9fcec 100644 --- a/macosx/HBSubtitles.m +++ b/macosx/HBSubtitles.m @@ -446,7 +446,7 @@ extern NSString *keySubTrackSrtFileURL; self = [super init]; decodeInt(_container); - decodeCollectionOfObjects(_sourceTracks, NSArray, NSDictionary); + decodeCollectionOfObjects2(_sourceTracks, NSArray, NSDictionary, NSURL); decodeCollectionOfObjects(_tracks, NSMutableArray, HBSubtitlesTrack); for (HBSubtitlesTrack *track in _tracks) |