Skip to content

fix: prevent "codec is released already" crash on Android#481

Open
tobias-ottenweller-knowunity wants to merge 1 commit intoSimformSolutionsPvtLtd:mainfrom
knowunity:main
Open

fix: prevent "codec is released already" crash on Android#481
tobias-ottenweller-knowunity wants to merge 1 commit intoSimformSolutionsPvtLtd:mainfrom
knowunity:main

Conversation

@tobias-ottenweller-knowunity
Copy link

@tobias-ottenweller-knowunity tobias-ottenweller-knowunity commented Feb 4, 2026

  • Add AtomicBoolean flag to ensure stop() executes only once
  • Check isStopped flag in MediaCodec callbacks before processing
  • Null out decoder/extractor references before releasing
  • Wrap release operations in try-catch for safety

Description

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have followed the Contributor Guide when preparing my PR.
  • [ ] I have updated/added tests for ALL new/updated/fixed functionality.
  • [ ] I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • [ ] I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

Fixes #477
as #478 crashed for me, this is another attempt resolving the underlying issue

- Add AtomicBoolean flag to ensure stop() executes only once
- Check isStopped flag in MediaCodec callbacks before processing
- Null out decoder/extractor references before releasing
- Wrap release operations in try-catch for safety

Fixes SimformSolutionsPvtLtd#477, SimformSolutionsPvtLtd#478
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Android bug : "codec is released already"

1 participant