Skip to content

Commit

Permalink
add disable buffering feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kolyvan committed Feb 12, 2013
1 parent cf7e911 commit bc398e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 3 additions & 0 deletions KxMovieExample/MainViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,9 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
parameters[KxMovieParameterDisableDeinterlacing] = @(YES);

// disable buffering
// parameters[KxMovieParameterMinBufferedDuration] = @(0.0f);

KxMovieViewController *vc = [KxMovieViewController movieViewControllerWithContentPath:path
parameters:parameters];
[self presentViewController:vc animated:YES completion:nil];
Expand Down
8 changes: 3 additions & 5 deletions kxmovie/KxMovieViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -970,9 +970,7 @@ - (void) tick
{
if (!self.playing)
return;

//CGFloat interval = [self presentFrame];


if (_buffered && _bufferedDuration > _minBufferedDuration) {

_buffered = NO;
Expand All @@ -996,14 +994,14 @@ - (void) tick
return;
}

if (!_buffered) {
if (_minBufferedDuration > 0 && !_buffered) {

_buffered = YES;
[_activityIndicatorView startAnimating];
}
}

if (_bufferedDuration < _minBufferedDuration) {
if (_bufferedDuration <= _minBufferedDuration) {

[self scheduleDecodeFrames];
}
Expand Down

0 comments on commit bc398e2

Please sign in to comment.