I'm working on replacing the audio track of my video with music from another file. So I modified the standard ExtractDecodeEditEncodeTest
code (from bigflake) so that the audio MediaExtractor
is created from said 'another file'. A strange thing happens when I try to send an EOS buffer into the audio decoder, however, in this line:
this.audioDecoder.queueInputBuffer(decoderInputBufferIndex, 0, 0, 0, MediaCodec.BUFFER_FLAG_END_OF_STREAM);
This netted me an android.media.MediaCodec$CodecException: Error 0xfffffff3
.
When I caught it in a try-catch-finally loop, it's apparently an android.media.MediaCodec.error_neg_13
(code: -13). The video still came out seemingly fine, however, with the replaced audio track.
As far as I searched, there is nothing about this error ,not even in the logs. Does anyone know what causes it and how I can prevent it from happening?