Skip to content

Commit

Permalink
Fix NPE when listener is not set
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 488970696
  • Loading branch information
Googler authored and microkatz committed Nov 21, 2022
1 parent ea7e8cf commit f52bb27
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -890,9 +890,11 @@ public boolean handleBuffer(
getSubmittedFrames() - trimmingAudioProcessor.getTrimmedFrameCount());
if (!startMediaTimeUsNeedsSync
&& Math.abs(expectedPresentationTimeUs - presentationTimeUs) > 200000) {
listener.onAudioSinkError(
new AudioSink.UnexpectedDiscontinuityException(
presentationTimeUs, expectedPresentationTimeUs));
if (listener != null) {
listener.onAudioSinkError(
new AudioSink.UnexpectedDiscontinuityException(
presentationTimeUs, expectedPresentationTimeUs));
}
startMediaTimeUsNeedsSync = true;
}
if (startMediaTimeUsNeedsSync) {
Expand Down

0 comments on commit f52bb27

Please sign in to comment.