code: public Frame read(long timestamp) {
          Frame frame = null;
          boolean locked = false;
          try {
              locked = this.lock.tryLock() || this.lock.tryLock(5, TimeUnit.MILLISECONDS);
              if (locked) {
                  frame = safeRead();
              } else {
                  this.ready.set(false);
              }
          } catch (InterruptedException e) {
              if (logger.isTraceEnabled()) {
                  logger.trace("Could not acquire reading lock for jitter buffer.");
              }
              this.ready.set(false);
          } finally {
              if (locked) {
                  lock.unlock();
              }
          }
          return frame;
      }
docs: Polls packet from buffer's head.
  
  @param timestamp the media time measured by reader
  @return the media frame.