Commit e2e7c43c by Googler Committed by christosts

Fix NPE when listener is not set

PiperOrigin-RevId: 488970696
(cherry picked from commit f52bb274)
parent 97d7ed7d
...@@ -991,9 +991,11 @@ public final class DefaultAudioSink implements AudioSink { ...@@ -991,9 +991,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) {
listener.onAudioSinkError( if (listener != null) {
new AudioSink.UnexpectedDiscontinuityException( listener.onAudioSinkError(
presentationTimeUs, expectedPresentationTimeUs)); new AudioSink.UnexpectedDiscontinuityException(
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