okamoto

Results 8 issues of okamoto

I think `info.set(0, 0, 0, flags and MediaCodec.BUFFER_FLAG_END_OF_STREAM)` is fine for `EOS`. Do you think it is correct ? ref: #139

There was a case where `buffer.isremining()` was false when used with `AudioEngine`. When I debugged, the capacity of buffer was 0. ![スクリーンショット 2021-12-22 20 49 19](https://user-images.githubusercontent.com/2928633/147205149-c147b90c-2a4d-49fe-a872-e82027681b0f.png) refs: #144 #153

> #138 > Library transcode video with artifacts. Link to video I have same issue. I checked the diffs for v0.9.1 and v0.10.0 and found that there was an issue...

notice: #170 should be merged before merging this PR. I added `State.wait` which doesn't call sleep. There are cases in `State.wait` where it is not necessary to call `Thread.sleep` ....

I trimmed the 10 minute video at the start 5 minutes and the end 5 minutes respectively. In the case of the end 5 minutes, it ended in about 6...

I used the demo app and I got the following error: ``` E/TranscodeEngine: Unexpected error while transcoding. java.nio.BufferOverflowException at java.nio.ByteBuffer.put(ByteBuffer.java:615) at com.otaliastudios.transcoder.sink.DefaultDataSink.enqueue(DefaultDataSink.java:191) at com.otaliastudios.transcoder.sink.DefaultDataSink.writeTrack(DefaultDataSink.java:165) at com.otaliastudios.transcoder.internal.utils.EosIgnoringDataSink.writeTrack(eos.kt:28) at com.otaliastudios.transcoder.internal.data.Writer.step(Writer.kt:52) at com.otaliastudios.transcoder.internal.pipeline.Pipeline.executeStep(Pipeline.kt:51)...

I used the demo app to select and run one video with audio and one without audio, and I got the following error: ``` E/TranscodeEngine: Unexpected error while transcoding. java.lang.IllegalStateException:...