mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 13:21:05 +00:00
Bug 1542440 - Recycle sample directly rather than through CodecProxy. r=jya
mJavaDecoder is invalid after the decoder is shut down and should never be used. Differential Revision: https://phabricator.services.mozilla.com/D26438 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
ef3c576ac4
commit
2441080e34
@ -243,7 +243,7 @@ class RemoteVideoDecoder : public RemoteDataDecoder {
|
||||
|
||||
AssertOnTaskQueue();
|
||||
if (GetState() == State::SHUTDOWN) {
|
||||
mJavaDecoder->DisposeOutput(aSample);
|
||||
aSample->Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
@ -427,7 +427,7 @@ class RemoteAudioDecoder : public RemoteDataDecoder {
|
||||
AssertOnTaskQueue();
|
||||
|
||||
if (GetState() == State::SHUTDOWN || !aBuffer->IsValid()) {
|
||||
mJavaDecoder->DisposeOutput(aSample);
|
||||
aSample->Dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -412,18 +412,6 @@ public final class CodecProxy {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Dispose Sample objects without sending requests to remote codec.
|
||||
// Native callbacks use this method instead of releaseOutput() to save
|
||||
// unnecessary IPC calls when recycling samples that have been released by
|
||||
// release() or flush().
|
||||
@WrapForJNI
|
||||
public void disposeOutput(final Sample sample) {
|
||||
if (mOutputSurface != null) {
|
||||
mSurfaceOutputs.remove(sample);
|
||||
}
|
||||
sample.dispose();
|
||||
}
|
||||
|
||||
/* package */ void reportError(final boolean fatal) {
|
||||
mCallbacks.reportError(fatal);
|
||||
}
|
||||
|
@ -98,6 +98,7 @@ public final class Sample implements Parcelable {
|
||||
crypto.mode);
|
||||
}
|
||||
|
||||
@WrapForJNI
|
||||
public void dispose() {
|
||||
if (isEOS()) {
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user