mirror of
https://github.com/androidx/media.git
synced 2025-05-17 04:29:55 +08:00
Trim memory when disabling ExtractorSampleSource.
This prevents memory leakage even in the case where the app is still holding a reference (direct or indirect) to the Allocator.
This commit is contained in:
parent
0d69a2eae8
commit
ed1dbddc75
@ -177,6 +177,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
|
||||
loader.cancelLoading();
|
||||
} else {
|
||||
clearState();
|
||||
bufferPool.trim(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -294,6 +295,7 @@ public class ExtractorSampleSource implements SampleSource, ExtractorOutput, Loa
|
||||
restartFrom(pendingResetPositionUs);
|
||||
} else {
|
||||
clearState();
|
||||
bufferPool.trim(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user