summaryrefslogtreecommitdiffstats
path: root/macosx/HBAudio.m
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/HBAudio.m')
-rw-r--r--macosx/HBAudio.m18
1 files changed, 10 insertions, 8 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];
}