Skip to content

Commit

Permalink
add init for grabber was not init. (#6405)
Browse files Browse the repository at this point in the history
replace substitute by nil for unused allocation.
  • Loading branch information
2bbb authored and ofTheo committed Oct 22, 2019
1 parent 3884d49 commit ab3a139
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/openFrameworks/video/ofAVFoundationGrabber.mm
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ - (BOOL)initCapture:(int)framerate capWidth:(int)w capHeight:(int)h{
//only set the framerate if it has been set by the user
if( framerate > 0 ){

AVFrameRateRange * desiredRange = [AVFrameRateRange alloc];
AVFrameRateRange * desiredRange = nil;
NSArray * supportedFrameRates = device.activeFormat.videoSupportedFrameRateRanges;

int numMatch = 0;
Expand Down Expand Up @@ -370,7 +370,7 @@ - (void)eraseGrabberPtr {

ofAVFoundationGrabber::ofAVFoundationGrabber(){
fps = -1;
grabber = [OSXVideoGrabber alloc];
grabber = [[OSXVideoGrabber alloc] init];
width = 0;
height = 0;
bIsInit = false;
Expand Down Expand Up @@ -419,7 +419,7 @@ - (void)eraseGrabberPtr {
bool ofAVFoundationGrabber::setup(int w, int h){

if( grabber == nil ){
grabber = [OSXVideoGrabber alloc];
grabber = [[OSXVideoGrabber alloc] init];
}

grabber->grabberPtr = this;
Expand Down Expand Up @@ -497,7 +497,7 @@ - (void)eraseGrabberPtr {

void ofAVFoundationGrabber::setDeviceID(int deviceID) {
if( grabber == nil ){
grabber = [OSXVideoGrabber alloc];
grabber = [[OSXVideoGrabber alloc] init];
}
[grabber setDevice:deviceID];
device = deviceID;
Expand Down

0 comments on commit ab3a139

Please sign in to comment.