Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrections and Mute option added #260

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Library/Sources/SCPlayer.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ - (id)init {
self = [super init];

if (self) {
_shouldSuppressPlayerRendering = YES;
_shouldSuppressPlayerRendering = NO;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want this to be false by default?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent black screen bug, when playing a movie preview.

[self addObserver:self forKeyPath:@"currentItem" options:NSKeyValueObservingOptionNew context:ItemChanged];
}

Expand Down Expand Up @@ -321,6 +321,8 @@ - (void)setItemByAsset:(AVAsset *)asset {
}

- (void)setItem:(AVPlayerItem *)item {
[self unsetupDisplayLink];
[self setupDisplayLink];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What those these two lines fix?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same previous bug, to prevent black screen bug, when playing a movie preview.

[self replaceCurrentItemWithPlayerItem:item];
}

Expand Down
3 changes: 1 addition & 2 deletions Library/Sources/SCRecordSession.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here you are simply ignoring the adjustment made to the buffer above. Why do you need to do that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To solve the previous audio buffer leak.

free(pInfo);
return sout;
}
Expand Down
5 changes: 5 additions & 0 deletions Library/Sources/SCRecorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
*/
@property (readonly, nonatomic) BOOL isRecording;

/**
If true the SCRecorder will only record video, not audio
*/
@property (nonatomic) BOOL mute;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can already do this by disabling the audio in audioConfiguration

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you post a snippet code?


/**
Change the flash mode on the camera
*/
Expand Down
2 changes: 1 addition & 1 deletion Library/Sources/SCRecorder.m
Original file line number Diff line number Diff line change
Expand Up @@ -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<SCRecorderDelegate> delegate = self.delegate;
// NSLog(@"APPENDING");

Expand Down