From ec1553108f3881a380904bcc8be7c19a626cb69a Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Tue, 27 Dec 2016 11:42:27 +0100 Subject: MacGui: fix audio and subtitles tracks when reloading a job from the queue. --- macosx/HBSubtitles.m | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'macosx/HBSubtitles.m') diff --git a/macosx/HBSubtitles.m b/macosx/HBSubtitles.m index 44113974d..549d06647 100644 --- a/macosx/HBSubtitles.m +++ b/macosx/HBSubtitles.m @@ -405,16 +405,18 @@ extern NSString *keySubTrackSrtFileURL; if (copy) { copy->_container = _container; - copy->_sourceTracks = [_sourceTracks mutableCopy]; + copy->_sourceTracks = [_sourceTracks copy]; copy->_tracks = [[NSMutableArray alloc] init]; - [_tracks enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { - if (idx < _tracks.count) - { - id trackCopy = [obj copy]; - [copy->_tracks addObject:trackCopy]; - } - }]; + + for (HBSubtitlesTrack *track in _tracks) + { + HBSubtitlesTrack *trackCopy = [track copy]; + [copy->_tracks addObject:trackCopy]; + + trackCopy.dataSource = copy; + trackCopy.delegate = copy; + } copy->_defaults = [_defaults copy]; } -- cgit v1.2.3