From 9388b33f20bdcc855cc056731ffaf7484be1ea2f Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Wed, 20 Jul 2022 13:43:16 +0200 Subject: [PATCH] bmd_hresult_to_string: print also error code --- src/blackmagic_common.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/blackmagic_common.cpp b/src/blackmagic_common.cpp index 8c44cb911..3a1df6cc1 100644 --- a/src/blackmagic_common.cpp +++ b/src/blackmagic_common.cpp @@ -46,6 +46,7 @@ #include "blackmagic_common.h" #include "DeckLinkAPIVersion.h" #include +#include #include #define MOD_NAME "[DeckLink] " @@ -69,11 +70,13 @@ static unordered_map bmd_hresult_to_string_map = { string bmd_hresult_to_string(HRESULT res) { + ostringstream oss; auto it = bmd_hresult_to_string_map.find(res); if (it != bmd_hresult_to_string_map.end()) { - return it->second; + oss << it->second; } - return {}; + oss << " " << "(0x" << hex << setfill('0') << setw(8) << res << ")"; + return oss.str(); } /**