File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
libraries/exoplayer/src/main/java/androidx/media3/exoplayer/audio Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 19
19
* Improve silence skipping algorithm with smooth volume ramp, retained
20
20
minimal silence and more natural silence durations
21
21
([ #7423 ] ( https://github.com/google/ExoPlayer/issues/7423 ) ).
22
+ * Report the skipped silence more deterministically
23
+ ([ #1035 ] ( https://github.com/androidx/media/issues/1035 ) ).
22
24
* Video:
23
25
* Text:
24
26
* Metadata:
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ public final class DefaultAudioSink implements AudioSink {
99
99
private static final int AUDIO_TRACK_SMALLER_BUFFER_RETRY_SIZE = 1_000_000 ;
100
100
101
101
/** The minimum duration of the skipped silence to be reported as discontinuity. */
102
- private static final int MINIMUM_REPORT_SKIPPED_SILENCE_DURATION_US = 1_000_000 ;
102
+ private static final int MINIMUM_REPORT_SKIPPED_SILENCE_DURATION_US = 300_000 ;
103
103
104
104
/**
105
105
* The delay of reporting the skipped silence, during which the default audio sink checks if there
@@ -2340,10 +2340,8 @@ private void maybeReportSkippedSilence() {
2340
2340
if (accumulatedSkippedSilenceDurationUs >= MINIMUM_REPORT_SKIPPED_SILENCE_DURATION_US ) {
2341
2341
// If the existing silence is already long enough, report the silence
2342
2342
listener .onSilenceSkipped ();
2343
+ accumulatedSkippedSilenceDurationUs = 0 ;
2343
2344
}
2344
- // Reset the accumulated silence anyway as the later silences are far from the current one
2345
- // and should be treated separately.
2346
- accumulatedSkippedSilenceDurationUs = 0 ;
2347
2345
}
2348
2346
2349
2347
@ RequiresApi (23 )
You can’t perform that action at this time.
0 commit comments