Skip to content

Commit

Permalink
Make sure all decoders are released
Browse files Browse the repository at this point in the history
Without catching decoder release exceptions, no more decoders are released after a release failed.
  • Loading branch information
protyposis committed Jan 2, 2017
1 parent c0d74f9 commit 0e67cbf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ public MediaCodecDecoder.FrameInfo decodeFrame(boolean force) {
*/
public void release() {
for (MediaCodecDecoder decoder : mDecoders) {
decoder.release();
// Catch decoder.release() exceptions to avoid breaking the release loop on the first
// exception and leaking unreleased decoders.
try {
decoder.release();
} catch (Exception e) {
Log.e(TAG, "release failed", e);
}
}
mDecoders.clear();
}
Expand Down

0 comments on commit 0e67cbf

Please sign in to comment.