Fix comments for pull request

- Extract duplicated microsecond duration calculation
- Update JavaDoc for CustomRenderersFactory
This commit is contained in:
Artem Shtefan 2025-11-07 00:31:46 +02:00
parent 6af820adae
commit 293914dfed
2 changed files with 6 additions and 4 deletions

View File

@ -306,10 +306,11 @@ public final class Player implements PlaybackListener, Listener {
final int maxSilenceDurationMillis = prefs.getInt(
context.getString(R.string.max_silence_duration_key),
Integer.parseInt(context.getString(R.string.max_silence_duration_value)));
final long maxSilenceDurationMicros = MILLISECONDS.toMicros(maxSilenceDurationMillis);
final SilenceSkippingAudioProcessor silenceSkippingAudioProcessor =
new SilenceSkippingAudioProcessor(
MILLISECONDS.toMicros(maxSilenceDurationMillis),
MILLISECONDS.toMicros(maxSilenceDurationMillis),
maxSilenceDurationMicros,
maxSilenceDurationMicros,
SilenceSkippingAudioProcessor.DEFAULT_SILENCE_THRESHOLD_LEVEL);
renderFactory = new CustomRenderersFactory(
context, alwaysUseExoplayerSetOutputSurfaceWorkaround,

View File

@ -17,8 +17,9 @@ import com.google.android.exoplayer2.video.VideoRendererEventListener;
import java.util.ArrayList;
/**
* A {@link DefaultRenderersFactory} which only uses {@link CustomMediaCodecVideoRenderer} as an
* implementation of video codec renders.
* A {@link DefaultRenderersFactory} which uses {@link CustomMediaCodecVideoRenderer} as an
* implementation of video codec renders and uses a provided {@link SilenceSkippingAudioProcessor}
* to control silence skipping behavior more precisely.
*
* <p>
* As no ExoPlayer extension is currently used, the reflection code used by ExoPlayer to try to