mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Remove unnecessary released
condition in getProgress
Removed the check for `released` flag to be able to pass the actual progress when the export completes. Also, removed resetting the `progressState` and `progressValue` to be able to get the actual progress. This block is also not necessary to have at this point. PiperOrigin-RevId: 712851526
This commit is contained in:
parent
0044d0cebc
commit
0074a97333
@ -32,7 +32,6 @@ import static androidx.media3.transformer.MuxerWrapper.MUXER_RELEASE_REASON_CANC
|
|||||||
import static androidx.media3.transformer.MuxerWrapper.MUXER_RELEASE_REASON_COMPLETED;
|
import static androidx.media3.transformer.MuxerWrapper.MUXER_RELEASE_REASON_COMPLETED;
|
||||||
import static androidx.media3.transformer.MuxerWrapper.MUXER_RELEASE_REASON_ERROR;
|
import static androidx.media3.transformer.MuxerWrapper.MUXER_RELEASE_REASON_ERROR;
|
||||||
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_AVAILABLE;
|
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_AVAILABLE;
|
||||||
import static androidx.media3.transformer.Transformer.PROGRESS_STATE_NOT_STARTED;
|
|
||||||
import static androidx.media3.transformer.TransformerUtil.getDecoderOutputColor;
|
import static androidx.media3.transformer.TransformerUtil.getDecoderOutputColor;
|
||||||
import static androidx.media3.transformer.TransformerUtil.getProcessedTrackType;
|
import static androidx.media3.transformer.TransformerUtil.getProcessedTrackType;
|
||||||
import static androidx.media3.transformer.TransformerUtil.getValidColor;
|
import static androidx.media3.transformer.TransformerUtil.getValidColor;
|
||||||
@ -290,10 +289,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
}
|
}
|
||||||
|
|
||||||
public @Transformer.ProgressState int getProgress(ProgressHolder progressHolder) {
|
public @Transformer.ProgressState int getProgress(ProgressHolder progressHolder) {
|
||||||
if (released) {
|
|
||||||
return PROGRESS_STATE_NOT_STARTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
synchronized (progressLock) {
|
synchronized (progressLock) {
|
||||||
if (progressState == PROGRESS_STATE_AVAILABLE) {
|
if (progressState == PROGRESS_STATE_AVAILABLE) {
|
||||||
progressHolder.progress = progressValue;
|
progressHolder.progress = progressValue;
|
||||||
@ -409,10 +404,6 @@ import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
|||||||
boolean releasedPreviously = released;
|
boolean releasedPreviously = released;
|
||||||
if (!released) {
|
if (!released) {
|
||||||
released = true;
|
released = true;
|
||||||
synchronized (progressLock) {
|
|
||||||
progressState = PROGRESS_STATE_NOT_STARTED;
|
|
||||||
progressValue = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.i(
|
Log.i(
|
||||||
TAG,
|
TAG,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user