decklink: Fix string handling causing plugin to not function
This commit is contained in:
parent
4652daf748
commit
7722698c7c
1 changed files with 4 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "../platform.hpp"
|
||||
|
||||
#include <util/platform.h>
|
||||
#include <comdef.h>
|
||||
|
||||
IDeckLinkDiscovery *CreateDeckLinkDiscoveryInstance(void)
|
||||
{
|
||||
|
|
@ -31,11 +32,10 @@ bool DeckLinkStringToStdString(decklink_string_t input, std::string &output)
|
|||
if (input == nullptr)
|
||||
return false;
|
||||
|
||||
size_t len = wcslen(input);
|
||||
size_t utf8_len = os_wcs_to_utf8(input, len, nullptr, 0);
|
||||
char *out = _com_util::ConvertBSTRToString(input);
|
||||
output = std::string(out);
|
||||
|
||||
output.resize(utf8_len);
|
||||
os_wcs_to_utf8(input, len, &output[0], utf8_len);
|
||||
delete[] out;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue