mirror of
https://github.com/androidx/media.git
synced 2025-05-10 00:59:51 +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.
|
* Add `TransformationRequest` for specifying the transformation options.
|
||||||
* Allow multiple listeners to be registered.
|
* Allow multiple listeners to be registered.
|
||||||
* Fix Transformer being stuck when the codec output is partially read.
|
* Fix Transformer being stuck when the codec output is partially read.
|
||||||
|
* Fix potential NPE in `Transformer.getProgress` when releasing the muxer
|
||||||
|
throws.
|
||||||
* MediaSession extension:
|
* MediaSession extension:
|
||||||
* Remove deprecated call to `onStop(/* reset= */ true)` and provide an
|
* 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.
|
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 {
|
private void releaseResources(boolean forCancellation) throws TransformationException {
|
||||||
verifyApplicationThread();
|
verifyApplicationThread();
|
||||||
|
progressState = PROGRESS_STATE_NO_TRANSFORMATION;
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
player.release();
|
player.release();
|
||||||
player = null;
|
player = null;
|
||||||
@ -787,7 +788,6 @@ public final class Transformer {
|
|||||||
}
|
}
|
||||||
muxerWrapper = null;
|
muxerWrapper = null;
|
||||||
}
|
}
|
||||||
progressState = PROGRESS_STATE_NO_TRANSFORMATION;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void verifyApplicationThread() {
|
private void verifyApplicationThread() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user