From a4ba35fe3afdf9d7ce8d8162b695c2066744a805 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Wed, 13 Feb 2019 15:15:11 -0700 Subject: [PATCH] audio_core: hle: mf: lint --- src/audio_core/hle/wmf_decoder_utils.cpp | 7 +++++-- src/audio_core/hle/wmf_decoder_utils.h | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/audio_core/hle/wmf_decoder_utils.cpp b/src/audio_core/hle/wmf_decoder_utils.cpp index e4055bfb2..21dd8a950 100644 --- a/src/audio_core/hle/wmf_decoder_utils.cpp +++ b/src/audio_core/hle/wmf_decoder_utils.cpp @@ -52,6 +52,8 @@ unique_mfptr MFDecoderInit(GUID audio_format) { if (FAILED(hr)) transform = nullptr; activate[n]->Release(); + if (SUCCEEDED(hr)) + break; } if (transform == nullptr) { ReportError("Failed to initialize MFT", hr); @@ -59,10 +61,11 @@ unique_mfptr MFDecoderInit(GUID audio_format) { return nullptr; } CoTaskMemFree(activate); - return std::move(transform); + return transform; } -unique_mfptr CreateSample(void* data, DWORD len, DWORD alignment, LONGLONG duration) { +unique_mfptr CreateSample(const void* data, DWORD len, DWORD alignment, + LONGLONG duration) { HRESULT hr = S_OK; unique_mfptr buf; unique_mfptr sample; diff --git a/src/audio_core/hle/wmf_decoder_utils.h b/src/audio_core/hle/wmf_decoder_utils.h index f9a75af79..26e1217a2 100644 --- a/src/audio_core/hle/wmf_decoder_utils.h +++ b/src/audio_core/hle/wmf_decoder_utils.h @@ -74,7 +74,7 @@ struct ADTSMeta { // exported functions unique_mfptr MFDecoderInit(GUID audio_format = MFAudioFormat_AAC); -unique_mfptr CreateSample(void* data, DWORD len, DWORD alignment = 1, +unique_mfptr CreateSample(const void* data, DWORD len, DWORD alignment = 1, LONGLONG duration = 0); bool SelectInputMediaType(IMFTransform* transform, int in_stream_id, const ADTSData& adts, const UINT8* user_data, UINT32 user_data_len,