// We can't make progress without one.
@Override
  protected void doSomeWork(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException {
    if (outputStreamEnded) {
      return;
    }
    sourceIsReady = source.continueBuffering(trackIndex, positionUs);
    checkForDiscontinuity(positionUs);
    // Try and read a format if we don't have one already.
    if (format == null && !readFormat(positionUs)) {
      // We can't make progress without one.
      return;
    }
    // If we don't have a decoder yet, we need to instantiate one.
    // TODO: Add support for dynamic switching between one type of surface to another.
    if (decoder == null) {
      decoder = new VpxDecoderWrapper(outputRgb);
      decoder.start();
    }
    // Rendering loop.
    try {
      processOutputBuffer(positionUs, elapsedRealtimeUs);
      while (feedInputBuffer(positionUs)) {}
    } catch (VpxDecoderException e) {
      notifyDecoderError(e);
      throw new ExoPlaybackException(e);
    }
  }
// Try and read a format if we don't have one already.
if (format == null && !readFormat(positionUs)) {
// We can't make progress without one.
return;
}
@Override
protected void doSomeWork(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException {
if (outputStreamEnded) {
return;
}
sourceIsReady = source.continueBuffering(trackIndex, positionUs);
checkForDiscontinuity(positionUs);
// Try and read a format if we don't have one already.
if (format == null && !readFormat(positionUs)) {
// We can't make progress without one.
return;
}
// If we don't have a decoder yet, we need to instantiate one.
// TODO: Add support for dynamic switching between one type of surface to another.
if (decoder == null) {
decoder = new VpxDecoderWrapper(outputRgb);
decoder.start();
}
// Rendering loop.
try {
@Override
protected void doSomeWork(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException {
if (outputStreamEnded) {
return;
}
sourceIsReady = source.continueBuffering(trackIndex, positionUs);
checkForDiscontinuity(positionUs);
// Try and read a format if we don't have one already.
if (format == null && !readFormat(positionUs)) {
// We can't make progress without one.
return;
}
// If we don't have a decoder yet, we need to instantiate one.
// TODO: Add support for dynamic switching between one type of surface to another.
if (decoder == null) {
decoder = new VpxDecoderWrapper(outputRgb);
decoder.start();
}
// Rendering loop.
try {
processOutputBuffer(positionUs, elapsedRealtimeUs);
while (feedInputBuffer(positionUs)) {}
} catch (VpxDecoderException e) {
notifyDecoderError(e);
throw new ExoPlaybackException(e);
}
}