Skip to content

Commit

Permalink
GPUImageTwoInputFilter newFrameReadyAtTime can't always pass on frame…
Browse files Browse the repository at this point in the history
… time from the first input

Sometimes the first input will be a GPUImagePicture with a frameTime of CMTimeIndefinite. I have added a check to see whether the firstFrameTime is indefinite, in which case the secondFrameTime is used.

The behaviour will be the same as before, unless the first input is a GPUImagePicture then the time will be used from the second input. Because the frameTime will always be indefinite it will always use the second frame time and therefore will be stable.
  • Loading branch information
karlvr committed Jul 24, 2013
1 parent 2f8e61c commit 68d930a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/Source/GPUImageTwoInputFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,8 @@ - (void)newFrameReadyAtTime:(CMTime)frameTime atIndex:(NSInteger)textureIndex;
// || (hasReceivedFirstFrame && secondFrameCheckDisabled) || (hasReceivedSecondFrame && firstFrameCheckDisabled)
if ((hasReceivedFirstFrame && hasReceivedSecondFrame) || updatedMovieFrameOppositeStillImage)
{
[super newFrameReadyAtTime:firstFrameTime atIndex:0]; // Bugfix when trying to record: always use time from first input
CMTime passOnFrameTime = (!CMTIME_IS_INDEFINITE(firstFrameTime)) ? firstFrameTime : secondFrameTime;
[super newFrameReadyAtTime:passOnFrameTime atIndex:0]; // Bugfix when trying to record: always use time from first input (unless indefinite, in which case use the second input)
hasReceivedFirstFrame = NO;
hasReceivedSecondFrame = NO;
}
Expand Down

0 comments on commit 68d930a

Please sign in to comment.