summaryrefslogtreecommitdiffstats
path: root/macosx/HBSubtitles.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-12-27 11:42:27 +0100
committerDamiano Galassi <[email protected]>2016-12-27 11:42:27 +0100
commitec1553108f3881a380904bcc8be7c19a626cb69a (patch)
tree27529c561dacc161c532f4cfea0185b3a6feb090 /macosx/HBSubtitles.m
parent5b8ac227c6ae46a7f58319ca9c0aa73f775e4ee1 (diff)
MacGui: fix audio and subtitles tracks when reloading a job from the queue.
Diffstat (limited to 'macosx/HBSubtitles.m')
-rw-r--r--macosx/HBSubtitles.m18
1 files changed, 10 insertions, 8 deletions
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];
}