public void position(long pos){
  log.debug("Position: {}",pos);
  log.debug("Current frame: {}",currentFrame);
  int len=frames.size();
  MP4Frame frame=null;
  for (int f=0; f < len; f++) {
    frame=frames.get(f);
    long offset=frame.getOffset();
    if (pos == offset || (offset > pos && frame.isKeyFrame())) {
      if (!frame.isKeyFrame()) {
        log.debug("Frame #{} was not a key frame, so trying again..",f);
        continue;
      }
      log.info("Frame #{} found for seek: {}",f,frame);
      createPreStreamingTags((int)(frame.getTime() * 1000),true);
      currentFrame=f;
      break;
    }
    prevVideoTS=(int)(frame.getTime() * 1000);
  }
  log.debug("Setting current frame: {}",currentFrame);
}

public void position ( long pos ) { log . debug ( "Position: {}" , pos ) ; log . debug ( "Current frame: {}" , currentFrame ) ; int len = frames . size ( ) ; MP4Frame frame = null ; for ( int f = 0 ; f < len ; f ++ ) { frame = frames . get ( f ) ; long offset = frame . getOffset ( ) ; if ( pos == offset || ( offset > pos && frame . isKeyFrame ( ) ) ) { if ( ! frame . isKeyFrame ( ) ) { log . debug ( "Frame #{} was not a key frame, so trying again.." , f ) ; continue ; } log . info ( "Frame #{} found for seek: {}" , f , frame ) ; createPreStreamingTags ( ( int ) ( frame . getTime ( ) * 1000 ) , true ) ; currentFrame = f ; break ; } prevVideoTS = ( int ) ( frame . getTime ( ) * 1000 ) ; } log . debug ( "Setting current frame: {}" , currentFrame ) ; }
put the current position to pos . the caller must ensure the pos is a valid one .
