code: @Override
      public int compareTo(MP4Frame that) {
          int ret = 0;
          if (this.time > that.getTime()) {
              ret = 1;
          } else if (this.time < that.getTime()) {
              ret = -1;
          } else if (Double.doubleToLongBits(time) == Double.doubleToLongBits(that.getTime()) && this.offset > that.getOffset()) {
              ret = 1;
          } else if (Double.doubleToLongBits(time) == Double.doubleToLongBits(that.getTime()) && this.offset < that.getOffset()) {
              ret = -1;
          }
          return ret;
      }
docs: The frames are expected to be sorted by their timestamp