code: private long getSafePts(long pts, int trackIndex) {
          if (mLastPts[trackIndex] >= pts) {
              // Enforce a non-zero minimum spacing
              // between pts
              mLastPts[trackIndex] += 9643;
              return mLastPts[trackIndex];
          }
          mLastPts[trackIndex] = pts;
          return pts;
      }
docs: Sometimes packets with non-increasing pts are dequeued from the MediaCodec output buffer.
  This method ensures that a crash won't occur due to non monotonically increasing packet timestamp.