mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fix NPE when listener is not set
PiperOrigin-RevId: 488970696
(cherry picked from commit f3ed9e359d)
This commit is contained in:
parent
73d40e1cfc
commit
c11b5cf91c
1 changed files with 5 additions and 3 deletions
|
|
@ -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…
Reference in a new issue