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:
kimvde 2022-01-27 21:40:34 +00:00 committed by Andrew Lewis
parent cfbdc7ba5b
commit 3a23383bc3

View File

@ -776,6 +776,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;
@ -789,7 +790,6 @@ public final class Transformer {
}
muxerWrapper = null;
}
progressState = PROGRESS_STATE_NO_TRANSFORMATION;
}
private void verifyApplicationThread() {