private void notifyAndThrowDecoderInitError(DecoderInitializationException e) throws ExoPlaybackException { notifyDecoderInitializationError(e); throw new ExoPlaybackException(e); }
private void maybeThrowError(SampleSourceReader source) throws ExoPlaybackException { try { source.maybeThrowError(); } catch (IOException e) { throw new ExoPlaybackException(e); } }
private boolean shouldWaitForKeys(boolean sampleEncrypted) throws ExoPlaybackException { if (!openedDrmSession) { return false; } int drmManagerState = drmSessionManager.getState(); if (drmManagerState == DrmSessionManager.STATE_ERROR) { throw new ExoPlaybackException(drmSessionManager.getError()); } if (drmManagerState != DrmSessionManager.STATE_OPENED_WITH_KEYS && (sampleEncrypted || !playClearSamplesWithoutKeys)) { return true; } return false; }
@Override protected void doSomeWork(long positionUs, long elapsedRealtimeUs) throws ExoPlaybackException { continueBufferingSource(positionUs); if (!inputStreamEnded && pendingMetadata == null) { int result = readSource(positionUs, formatHolder, sampleHolder, false); if (result == SampleSource.SAMPLE_READ) { pendingMetadataTimestamp = sampleHolder.timeUs; try { pendingMetadata = metadataParser.parse(sampleHolder.data.array(), sampleHolder.size); } catch (IOException e) { throw new ExoPlaybackException(e); } sampleHolder.data.clear(); } else if (result == SampleSource.END_OF_STREAM) { inputStreamEnded = true; } } if (pendingMetadata != null && pendingMetadataTimestamp <= positionUs) { invokeRenderer(pendingMetadata); pendingMetadata = null; } }
} catch (RuntimeException e) { Log.e(TAG, "Internal runtime error.", e); eventHandler.obtainMessage(MSG_ERROR, new ExoPlaybackException(e, true)).sendToTarget(); stopInternal(); return true;
throw new ExoPlaybackException(e); } catch (CryptoException e) { notifyCryptoError(e); throw new ExoPlaybackException(e);
throw new ExoPlaybackException(e); } catch (AudioTrack.WriteException e) { notifyAudioTrackWriteError(e); throw new ExoPlaybackException(e);
if (drmInitData != null) { if (drmSessionManager == null) { throw new ExoPlaybackException("Media requires a DrmSessionManager"); throw new ExoPlaybackException(drmSessionManager.getError()); } else if (drmSessionState == DrmSessionManager.STATE_OPENED || drmSessionState == DrmSessionManager.STATE_OPENED_WITH_KEYS) {
nextSubtitle = parserHelper.getAndClearResult(); } catch (IOException e) { throw new ExoPlaybackException(e);