You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
MediaCodec: release all output buffers on release
This prevents leaking video memory
This commit is contained in:
@@ -147,8 +147,15 @@ public class MediaCodec {
|
||||
|
||||
public void release() {
|
||||
System.out.println("MediaCodec.release(): codecName=" + codecName);
|
||||
if (native_codec != 0)
|
||||
if (native_codec != 0) {
|
||||
if (outputBuffers != null) {
|
||||
for (int i=0; i<outputBuffers.length; i++) {
|
||||
if (!freeOutputBuffers.contains(i))
|
||||
releaseOutputBuffer(i, false);
|
||||
}
|
||||
}
|
||||
native_release(native_codec);
|
||||
}
|
||||
native_codec = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user