Skip to content

Commit 293914d

Browse files
Artem ShtefanArtem Shtefan
authored andcommitted
Fix comments for pull request
- Extract duplicated microsecond duration calculation - Update JavaDoc for CustomRenderersFactory
1 parent 6af820a commit 293914d

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

app/src/main/java/org/schabi/newpipe/player/Player.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,11 @@ public Player(@NonNull final PlayerService service,
306306
final int maxSilenceDurationMillis = prefs.getInt(
307307
context.getString(R.string.max_silence_duration_key),
308308
Integer.parseInt(context.getString(R.string.max_silence_duration_value)));
309+
final long maxSilenceDurationMicros = MILLISECONDS.toMicros(maxSilenceDurationMillis);
309310
final SilenceSkippingAudioProcessor silenceSkippingAudioProcessor =
310311
new SilenceSkippingAudioProcessor(
311-
MILLISECONDS.toMicros(maxSilenceDurationMillis),
312-
MILLISECONDS.toMicros(maxSilenceDurationMillis),
312+
maxSilenceDurationMicros,
313+
maxSilenceDurationMicros,
313314
SilenceSkippingAudioProcessor.DEFAULT_SILENCE_THRESHOLD_LEVEL);
314315
renderFactory = new CustomRenderersFactory(
315316
context, alwaysUseExoplayerSetOutputSurfaceWorkaround,

app/src/main/java/org/schabi/newpipe/player/helper/CustomRenderersFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
import java.util.ArrayList;
1818

1919
/**
20-
* A {@link DefaultRenderersFactory} which only uses {@link CustomMediaCodecVideoRenderer} as an
21-
* implementation of video codec renders.
20+
* A {@link DefaultRenderersFactory} which uses {@link CustomMediaCodecVideoRenderer} as an
21+
* implementation of video codec renders and uses a provided {@link SilenceSkippingAudioProcessor}
22+
* to control silence skipping behavior more precisely.
2223
*
2324
* <p>
2425
* As no ExoPlayer extension is currently used, the reflection code used by ExoPlayer to try to

0 commit comments

Comments
 (0)