Skip to content

Commit

Permalink
Suppress @VisibleForTesting violation in Transformer
Browse files Browse the repository at this point in the history
#minor-release

PiperOrigin-RevId: 430200331
  • Loading branch information
icbaker committed Feb 23, 2022
1 parent c0d0c0a commit 3ac831b
Showing 1 changed file with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ private void startTransformation(MediaItem mediaItem, Muxer muxer) {
DEFAULT_BUFFER_FOR_PLAYBACK_MS / 10,
DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS / 10)
.build();
player =
ExoPlayer.Builder playerBuilder =
new ExoPlayer.Builder(
context,
new TransformerRenderersFactory(
Expand All @@ -679,9 +679,15 @@ private void startTransformation(MediaItem mediaItem, Muxer muxer) {
.setMediaSourceFactory(mediaSourceFactory)
.setTrackSelector(trackSelector)
.setLoadControl(loadControl)
.setLooper(looper)
.setClock(clock)
.build();
.setLooper(looper);
if (clock != Clock.DEFAULT) {
// Transformer.Builder#setClock is also @VisibleForTesting, so if we're using a non-default
// clock we must be in a test context.
@SuppressWarnings("VisibleForTests")
ExoPlayer.Builder unusedForAnnotation = playerBuilder.setClock(clock);
}

player = playerBuilder.build();
player.setMediaItem(mediaItem);
player.addListener(new TransformerPlayerListener(mediaItem, muxerWrapper));
player.prepare();
Expand Down

0 comments on commit 3ac831b

Please sign in to comment.