mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-05-14 02:14:39 -04:00
decklink: Fix string handling causing plugin to not function
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user