diff --git a/src/backend/media/biz-media/src/main/kotlin/com/tencent/bkrepo/media/stream/Mux.kt b/src/backend/media/biz-media/src/main/kotlin/com/tencent/bkrepo/media/stream/Mux.kt index 126f4c00a3..61393d6fca 100644 --- a/src/backend/media/biz-media/src/main/kotlin/com/tencent/bkrepo/media/stream/Mux.kt +++ b/src/backend/media/biz-media/src/main/kotlin/com/tencent/bkrepo/media/stream/Mux.kt @@ -82,17 +82,16 @@ class Mux { ) ifmtCtx!!.pb(avio) } - check(avformat.avformat_open_input(ifmtCtx, fileName, null, null) >= 0) { "open failed" } - check(avformat.avformat_find_stream_info(ifmtCtx, null as? PointerPointer<*>) >= 0) { - "can't find stream info" - } + var ret = avformat.avformat_open_input(ifmtCtx, fileName, null, null) + check(ret >= 0) { "open failed [$ret]" } + ret = avformat.avformat_find_stream_info(ifmtCtx, null as? PointerPointer<*>) + check(ret >= 0) { "can't find stream info [$ret]" } if (logger.isDebugEnabled) { avformat.av_dump_format(ifmtCtx, 0, fileName, 0) } val outputFilePath = outputFile!!.absolutePath - check(avformat.avformat_alloc_output_context2(ofmtCtx, null, null, outputFilePath) >= 0) { - "create output ctx error" - } + ret = avformat.avformat_alloc_output_context2(ofmtCtx, null, null, outputFilePath) + check(ret >= 0) { "create output ctx error [$ret]" } val streamMapping = mutableMapOf() var streamIndex = 0 @@ -271,6 +270,7 @@ class Mux { val b = ByteArray(buf_size) val size = inputStream.read(b) return if (size < 0) { + logger.info("input end") avutil.AVERROR_EOF } else { buf.put(b, 0, size)