diff --git a/CocoaSplit.xcodeproj/project.xcworkspace/xcuserdata/zakk.xcuserdatad/UserInterfaceState.xcuserstate b/CocoaSplit.xcodeproj/project.xcworkspace/xcuserdata/zakk.xcuserdatad/UserInterfaceState.xcuserstate index c5138db7..c82bec82 100644 Binary files a/CocoaSplit.xcodeproj/project.xcworkspace/xcuserdata/zakk.xcuserdatad/UserInterfaceState.xcuserstate and b/CocoaSplit.xcodeproj/project.xcworkspace/xcuserdata/zakk.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/CocoaSplit/Compressor/x264Compressor.m b/CocoaSplit/Compressor/x264Compressor.m index bdd733f3..4826aecb 100644 --- a/CocoaSplit/Compressor/x264Compressor.m +++ b/CocoaSplit/Compressor/x264Compressor.m @@ -232,7 +232,7 @@ CMTime pts = frameData.videoPTS; - + NSLog(@"FRAME PTS %@", CMTimeCopyDescription(NULL, pts)); size_t src_height; size_t src_width; @@ -251,7 +251,8 @@ } int64_t usePts = av_rescale_q(pts.value, (AVRational){1,1000}, _av_codec_ctx->time_base); - + NSLog(@"USE PTS %lld", usePts); + if (_last_pts > 0 && usePts <= _last_pts) { //We got the frame too fast, or something else weird happened. Just send the audio along @@ -265,6 +266,7 @@ [dest writeEncodedData:frameData]; } + NSLog(@"DID NOT ENCODE"); return; } @@ -437,7 +439,7 @@ _av_codec_ctx->width = self.working_width; _av_codec_ctx->height = self.working_height; _av_codec_ctx->time_base.num = 1; - _av_codec_ctx->time_base.den = 1000; + _av_codec_ctx->time_base.den = captureFPS; diff --git a/CocoaSplit/InputSource.m b/CocoaSplit/InputSource.m index 39b04a69..52822004 100644 --- a/CocoaSplit/InputSource.m +++ b/CocoaSplit/InputSource.m @@ -1858,6 +1858,8 @@ static NSArray *_sourceTypes = nil; self.layer.bounds = iRect; } + + -(void) updateSize:(CGFloat)width height:(CGFloat)height { @@ -1871,6 +1873,7 @@ static NSArray *_sourceTypes = nil; bool oldResize = self.layer.allowResize; bool tmpResize = oldResize; + if (self.layer) { if (self.resizeType & kResizeFree) @@ -1892,6 +1895,9 @@ static NSArray *_sourceTypes = nil; } else { if (self.resizeType & kResizeLeft) { + //Where does the origin need to be to keep the right side in the same place? + CGFloat oldRight = NSMaxX(oldLayout); + newLayout.origin.x -= delta_w; } @@ -1905,6 +1911,7 @@ static NSArray *_sourceTypes = nil; newLayout.size.width = width; newLayout.size.height = height; + self.layer.allowResize = tmpResize; NSRect iRect = NSIntegralRect(newLayout); NSRect cFrame = oldLayout; diff --git a/CocoaSplit/PreviewView.m b/CocoaSplit/PreviewView.m index faa068a3..bb82fc49 100644 --- a/CocoaSplit/PreviewView.m +++ b/CocoaSplit/PreviewView.m @@ -727,11 +727,15 @@ _inDrag = YES; tmp = [self convertPoint:theEvent.locationInWindow fromView:nil]; - //NSLog(@"DELTA X %f Y %f", theEvent.deltaX, theEvent.deltaY); worldPoint = [self realPointforWindowPoint:tmp]; + NSRect worldRect = NSIntegralRect(NSMakeRect(worldPoint.x, worldPoint.y , self.selectedSource.globalLayoutPosition.size.width, self.selectedSource.globalLayoutPosition.size.height)); + + worldPoint = worldRect.origin; + + CGFloat dx, dy; dx = (worldPoint.x - self.selectedOriginDistance.x); @@ -740,19 +744,9 @@ [self adjustDeltas:&dx dy:&dy]; + self.selectedOriginDistance = worldPoint; - if (theEvent.deltaX == 0) - { - dx = 0; - } - - if (theEvent.deltaY == 0) - { - dy = 0; - } - - //NSLog(@"DX %f DY %f", dx, dy); if (self.isResizing) { @@ -801,26 +795,29 @@ new_width = sPosition.size.width; new_height = sPosition.size.height; - if (self.resizeType & kResizeRight) + if (self.resizeType & kResizeRight && dx) { - new_width += dx; + new_width = worldPoint.x - sPosition.origin.x; + } - if (self.resizeType & kResizeLeft) + if (self.resizeType & kResizeLeft && dx) { - new_width -= dx; + new_width = (sPosition.origin.x+sPosition.size.width) - worldPoint.x; } - if (self.resizeType & kResizeTop) + if (self.resizeType & kResizeTop && dy) { - new_height += dy; + + new_height = worldPoint.y - sPosition.origin.y; } - if (self.resizeType & kResizeBottom) + if (self.resizeType & kResizeBottom && dy) { - new_height -= dy; + + new_height = NSMaxY(sPosition) - worldPoint.y; }