summaryrefslogtreecommitdiffstats
path: root/Whisper
diff options
context:
space:
mode:
authorKonstantin <const@const.me>2023-01-20 13:31:49 +0100
committerKonstantin <const@const.me>2023-01-20 13:31:49 +0100
commit8880867a950f78292f8cf4b37771b08dd0376074 (patch)
tree2d916a0b367769830dfc49d4f20bbb6d2035ba88 /Whisper
parentf6f743c7b3570b85ccf47f74b84e06a73667ef3e (diff)
Minor, error handling
Diffstat (limited to 'Whisper')
-rw-r--r--Whisper/MF/PcmReader.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Whisper/MF/PcmReader.cpp b/Whisper/MF/PcmReader.cpp
index 16f38c6..fa39191 100644
--- a/Whisper/MF/PcmReader.cpp
+++ b/Whisper/MF/PcmReader.cpp
@@ -1,6 +1,7 @@
#include "stdafx.h"
#include "PcmReader.h"
#include <mfapi.h>
+#include <Mferror.h>
#include "mfUtils.h"
namespace Whisper
@@ -130,6 +131,12 @@ namespace
{
CComPtr<IMFTransform> mft;
HRESULT hr = readerEx->GetTransformForStream( stream, i, &category, &mft );
+ if( hr == MF_E_INVALIDINDEX )
+ {
+ // This happens for *.wav input files
+ // They don't have any MFT_CATEGORY_AUDIO_DECODER MFTs in the source reader, and it's not an error
+ return S_FALSE;
+ }
if( FAILED( hr ) )
return hr;
const __m128i cat = _mm_load_si128( ( const __m128i* ) & category );