diff --git a/package/android/src/main/java/com/mrousavy/camera/core/ChunkedRecorder.kt b/package/android/src/main/java/com/mrousavy/camera/core/ChunkedRecorder.kt index ea1439b..a304d37 100644 --- a/package/android/src/main/java/com/mrousavy/camera/core/ChunkedRecorder.kt +++ b/package/android/src/main/java/com/mrousavy/camera/core/ChunkedRecorder.kt @@ -95,16 +95,14 @@ class ChunkedRecordingManager(private val encoder: MediaCodec, private val outpu fun finish() { muxer.stop() muxer.release() + this.callbacks.onVideoChunkReady(filepath, chunkIndex) } } private var muxerContext: MuxerContext? = null private fun createNextMuxer(bufferInfo: BufferInfo) { - muxerContext?.let { - it.finish() - this.callbacks.onVideoChunkReady(it.filepath, it.chunkIndex) - } + muxerContext?.finish() chunkIndex++ val newFileName = "$chunkIndex.mp4"