From dc004bf0957a9b943a9968580a77d29c8ab65ab4 Mon Sep 17 00:00:00 2001 From: Fredrik Mellbin Date: Fri, 29 Mar 2024 11:28:34 +0100 Subject: [PATCH] Fix 24 bit audio in vfw --- src/vfw/vsvfw.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vfw/vsvfw.cpp b/src/vfw/vsvfw.cpp index 083bc16f0..4bd04fda8 100644 --- a/src/vfw/vsvfw.cpp +++ b/src/vfw/vsvfw.cpp @@ -862,7 +862,7 @@ HRESULT VapourSynthStream::Read2(LONG lStart, LONG lSamples, LPVOID lpBuffer, LO size_t offset = 0; size_t copyLength = VS_AUDIO_FRAME_SAMPLES; if (firstFrameSample < lStart) { - offset = (lStart - firstFrameSample) * bytesPerOutputSample; + offset = (lStart - firstFrameSample) * ai->format.bytesPerSample; copyLength -= (lStart - firstFrameSample); } if (lSamples < copyLength)