Skip to content

Commit 03f7166

Browse files
Artem ShtefanArtem Shtefan
authored andcommitted
Fix comments for pull request
- Extract duplicated microsecond duration calculation - Update JavaDoc for CustomRenderersFactory
1 parent 4e88b7c commit 03f7166

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
@@ -300,10 +300,11 @@ public Player(@NonNull final PlayerService service,
300300
final int maxSilenceDurationMillis = prefs.getInt(
301301
context.getString(R.string.max_silence_duration_key),
302302
Integer.parseInt(context.getString(R.string.max_silence_duration_value)));
303+
final long maxSilenceDurationMicros = MILLISECONDS.toMicros(maxSilenceDurationMillis);
303304
final SilenceSkippingAudioProcessor silenceSkippingAudioProcessor =
304305
new SilenceSkippingAudioProcessor(
305-
MILLISECONDS.toMicros(maxSilenceDurationMillis),
306-
MILLISECONDS.toMicros(maxSilenceDurationMillis),
306+
maxSilenceDurationMicros,
307+
maxSilenceDurationMicros,
307308
SilenceSkippingAudioProcessor.DEFAULT_SILENCE_THRESHOLD_LEVEL);
308309
renderFactory = new CustomRenderersFactory(
309310
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)