Commit 1d0425e2 by kimvde Committed by Ian Baker

Make input media duration volatile

The duration in TransformerInternal.ComponentListener is set on the
Transformer internal thread, and is read on the playback thread. Making
this field volatile ensures that the playback thread reads the updated
value.

PiperOrigin-RevId: 493908385
parent fd12fc1f
......@@ -377,9 +377,9 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
private final MediaItem mediaItem;
private final FallbackListener fallbackListener;
private long durationUs;
private int tracksAddedCount;
private volatile long durationUs;
private volatile boolean trackRegistered;
public ComponentListener(MediaItem mediaItem, FallbackListener fallbackListener) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment