Commit f52bb274 by Googler Committed by microkatz

Fix NPE when listener is not set

PiperOrigin-RevId: 488970696
parent ea7e8cff
...@@ -890,9 +890,11 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -890,9 +890,11 @@ public final class DefaultAudioSink implements AudioSink {
getSubmittedFrames() - trimmingAudioProcessor.getTrimmedFrameCount()); getSubmittedFrames() - trimmingAudioProcessor.getTrimmedFrameCount());
if (!startMediaTimeUsNeedsSync if (!startMediaTimeUsNeedsSync
&& Math.abs(expectedPresentationTimeUs - presentationTimeUs) > 200000) { && Math.abs(expectedPresentationTimeUs - presentationTimeUs) > 200000) {
if (listener != null) {
listener.onAudioSinkError( listener.onAudioSinkError(
new AudioSink.UnexpectedDiscontinuityException( new AudioSink.UnexpectedDiscontinuityException(
presentationTimeUs, expectedPresentationTimeUs)); presentationTimeUs, expectedPresentationTimeUs));
}
startMediaTimeUsNeedsSync = true; startMediaTimeUsNeedsSync = true;
} }
if (startMediaTimeUsNeedsSync) { if (startMediaTimeUsNeedsSync) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment