From 394d2104fc112b27e545c6b3f7ce09732426b5eb Mon Sep 17 00:00:00 2001 From: losewayy Date: Sat, 14 Nov 2026 19:45:33 +0800 Subject: [PATCH] fix: trim MiniMax-H3 audio to video duration (#2350) --- src/pipeline/video.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pipeline/video.cpp b/src/pipeline/video.cpp index 915dc54b..ab645407 100644 --- a/src/pipeline/video.cpp +++ b/src/pipeline/video.cpp @@ -2287,12 +2287,12 @@ namespace sd::pipeline { if (frames_out != nullptr) { *frames_out = result; } - if (sd->version == VERSION_WAN2_2_S2V && generated_audio != nullptr) { - // Limit the driving track to the generated video's duration. + if ((sd->version == VERSION_WAN2_2_S2V || sd_version_is_minimax_h3(sd->version)) && generated_audio != nullptr) { + // Limit the audio track to the generated video's duration. int fps = request.fps; uint64_t video_frames = num_frames_out != nullptr ? (uint64_t)*num_frames_out : 0; uint64_t want_samples = (uint64_t)((double)video_frames / fps * generated_audio->sample_rate); - LOG_DEBUG("s2v audio truncate: %llu samples -> %llu (video %llu frames @ %d fps)", + LOG_DEBUG("output audio truncate: %llu samples -> %llu (video %llu frames @ %d fps)", (unsigned long long)generated_audio->sample_count, (unsigned long long)want_samples, (unsigned long long)video_frames,