code: private int getFrame(long pos) {
          int sample = 1;
          int len = frames.size();
          MP4Frame frame = null;
          for (int f = 0; f < len; f++) {
              frame = frames.get(f);
              if (pos == frame.getOffset()) {
                  sample = f;
                  break;
              }
          }
          return sample;
      }
docs: Search through the frames by offset / position to find the sample.
  
  @param pos
  @return frame index