mirror of
https://github.com/androidx/media.git
synced 2025-05-09 16:40:55 +08:00
Fix NPE in Transformer.getProgress()
If muxerWrapper.release() was throwing an exception, the progress state was not updated and getProgress could throw an exception. #minor-release PiperOrigin-RevId: 424696783
This commit is contained in:
parent
6e305936b8
commit
1402bd6f54
@ -112,6 +112,8 @@
|
||||
* Add `TransformationRequest` for specifying the transformation options.
|
||||
* Allow multiple listeners to be registered.
|
||||
* Fix Transformer being stuck when the codec output is partially read.
|
||||
* Fix potential NPE in `Transformer.getProgress` when releasing the muxer
|
||||
throws.
|
||||
* MediaSession extension:
|
||||
* Remove deprecated call to `onStop(/* reset= */ true)` and provide an
|
||||
opt-out flag for apps that don't want to clear the playlist on stop.
|
||||
|
@ -774,6 +774,7 @@ public final class Transformer {
|
||||
*/
|
||||
private void releaseResources(boolean forCancellation) throws TransformationException {
|
||||
verifyApplicationThread();
|
||||
progressState = PROGRESS_STATE_NO_TRANSFORMATION;
|
||||
if (player != null) {
|
||||
player.release();
|
||||
player = null;
|
||||
@ -787,7 +788,6 @@ public final class Transformer {
|
||||
}
|
||||
muxerWrapper = null;
|
||||
}
|
||||
progressState = PROGRESS_STATE_NO_TRANSFORMATION;
|
||||
}
|
||||
|
||||
private void verifyApplicationThread() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user