diff --git a/Library/Sources/SCPlayer.m b/Library/Sources/SCPlayer.m index 7a27e2e5..e41461be 100644 --- a/Library/Sources/SCPlayer.m +++ b/Library/Sources/SCPlayer.m @@ -39,7 +39,7 @@ - (id)init { self = [super init]; if (self) { - _shouldSuppressPlayerRendering = YES; + _shouldSuppressPlayerRendering = NO; [self addObserver:self forKeyPath:@"currentItem" options:NSKeyValueObservingOptionNew context:ItemChanged]; } @@ -321,6 +321,8 @@ - (void)setItemByAsset:(AVAsset *)asset { } - (void)setItem:(AVPlayerItem *)item { + [self unsetupDisplayLink]; + [self setupDisplayLink]; [self replaceCurrentItemWithPlayerItem:item]; } diff --git a/Library/Sources/SCRecordSession.m b/Library/Sources/SCRecordSession.m index 9cc91131..cdab9f6e 100644 --- a/Library/Sources/SCRecordSession.m +++ b/Library/Sources/SCRecordSession.m @@ -439,8 +439,7 @@ - (CMSampleBufferRef)adjustBuffer:(CMSampleBufferRef)sample withTimeOffset:(CMTi pInfo[i].duration = duration; } - CMSampleBufferRef sout; - CMSampleBufferCreateCopyWithNewTiming(nil, sample, count, pInfo, &sout); + CMSampleBufferRef sout = sample; free(pInfo); return sout; } diff --git a/Library/Sources/SCRecorder.h b/Library/Sources/SCRecorder.h index fd5bd0e4..40d3c71f 100644 --- a/Library/Sources/SCRecorder.h +++ b/Library/Sources/SCRecorder.h @@ -53,6 +53,11 @@ */ @property (readonly, nonatomic) BOOL isRecording; +/** + If true the SCRecorder will only record video, not audio + */ +@property (nonatomic) BOOL mute; + /** Change the flash mode on the camera */ diff --git a/Library/Sources/SCRecorder.m b/Library/Sources/SCRecorder.m index cf9d09a0..e816bbed 100644 --- a/Library/Sources/SCRecorder.m +++ b/Library/Sources/SCRecorder.m @@ -789,7 +789,7 @@ - (void)_handleAudioSampleBuffer:(CMSampleBufferRef)sampleBuffer withSession:(SC if (!self.videoEnabledAndReady || recordSession.videoInitialized || recordSession.videoInitializationFailed) { [self beginRecordSegmentIfNeeded:recordSession]; - if (_isRecording && recordSession.recordSegmentReady && (!self.videoEnabledAndReady || recordSession.currentSegmentHasVideo)) { + if (!self.mute && _isRecording && recordSession.recordSegmentReady && (!self.videoEnabledAndReady || recordSession.currentSegmentHasVideo)) { id delegate = self.delegate; // NSLog(@"APPENDING");