Proper exception handling needed
Opened this issue ยท 0 comments
daschaa commented
Hi there ๐
We are currently facing an issue with your library that we get an IllegalStateException
when calling the VideoSlimmer.releaseCoder()
method.
android.media.MediaCodec.native_stop MediaCodec.java
android.media.MediaCodec.stop MediaCodec.java:2251
com.zolad.videoslimmer.VideoSlimEncoder.releaseCoder VideoSlimEncoder.java:613
com.zolad.videoslimmer.VideoSlimEncoder.convertVideo VideoSlimEncoder.java:391
com.zolad.videoslimmer.VideoSlimTask.doInBackground VideoSlimTask.java:30
com.zolad.videoslimmer.VideoSlimTask.doInBackground VideoSlimTask.java:11
android.os.AsyncTask$3.call AsyncTask.java:394
java.util.concurrent.FutureTask.run FutureTask.java:266
android.os.AsyncTask$SerialExecutor$1.run AsyncTask.java:305
java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java:1167
java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java:641
java.lang.Thread.run Thread.java:923
We found out that this comes up when an encoder was already released when calling stop. See here https://developer.android.com/reference/android/media/MediaCodec?hl=en#stop()
We would suggest to wrap the releaseCoder()
method in an exception handling block and catching RuntimeExceptions ( see #8).