Fix NPE when listener is not set
PiperOrigin-RevId: 488970696 (cherry picked from commit f3ed9e359dfdff2a99bf8766ffceb59a93d1bc93)
This commit is contained in:
parent
73d40e1cfc
commit
c11b5cf91c
@ -1000,9 +1000,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) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user