summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2016-12-27 11:42:27 +0100
committerDamiano Galassi <[email protected]>2016-12-27 13:58:43 +0100
commit1040fe1f589834fcebf052b9bc48fda34af4b57a (patch)
treefef5e4d1198d0682dd6db64678dfe31a23769111 /macosx
parentaa8096c72da0111f0598c5228792b759ebd74417 (diff)
MacGui: fix audio and subtitles tracks when reloading a job from the queue.
(cherry picked from commit ec1553108f3881a380904bcc8be7c19a626cb69a)
Diffstat (limited to 'macosx')
-rw-r--r--macosx/HBAudio.m18
-rw-r--r--macosx/HBSubtitles.m18
2 files changed, 20 insertions, 16 deletions
diff --git a/macosx/HBAudio.m b/macosx/HBAudio.m
index 20862938c..1faae116e 100644
--- a/macosx/HBAudio.m
+++ b/macosx/HBAudio.m
@@ -244,16 +244,18 @@ NSString *HBAudioChangedNotification = @"HBAudioChangedNotification";
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 (HBAudioTrack *track in _tracks)
+ {
+ HBAudioTrack *trackCopy = [track copy];
+ [copy->_tracks addObject:trackCopy];
+
+ trackCopy.dataSource = copy;
+ trackCopy.delegate = copy;
+ }
copy->_defaults = [_defaults copy];
}
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];
}