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
This commit is contained in:
parent
d64a7ec55c
commit
cda969985e
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user