AbedElazizShe / LightCompressor

A powerful and easy-to-use video compression library for android uses MediaCodec API.
Apache License 2.0
537 stars 116 forks source link

Force compressing code to run in IO thread #171

Closed amrreda1995 closed 1 year ago

amrreda1995 commented 1 year ago

Firebase crashlytics reported that there's some ANR happens because of some block of code running in the main thread After Investigation, I found that the compressing library code uses EmptyCoroutineContext which is considered the app main thread This PR has small fix for this issue by providing the IO context for kotlin coroutines to force code to be run in the IO thread

AbedElazizShe commented 1 year ago

Thank you @amrreda1995