coreaudio-encoder: Use libobs CFString utils
This commit is contained in:
parent
94b30ec05a
commit
b1e837a18a
1 changed files with 2 additions and 10 deletions
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#ifndef _WIN32
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
#include <util/apple/cfstring-utils.h>
|
||||
#endif
|
||||
|
||||
#define CA_LOG(level, format, ...) \
|
||||
|
|
@ -257,17 +258,8 @@ static DStr osstatus_to_dstr(OSStatus code)
|
|||
kCFErrorDomainOSStatus, code, NULL)};
|
||||
cf_ptr<CFStringRef> str{CFErrorCopyDescription(err.get())};
|
||||
|
||||
CFIndex length = CFStringGetLength(str.get());
|
||||
CFIndex max_size = CFStringGetMaximumSizeForEncoding(length,
|
||||
kCFStringEncodingUTF8);
|
||||
|
||||
dstr_ensure_capacity(result, max_size);
|
||||
|
||||
if (result->array && CFStringGetCString(str.get(), result->array,
|
||||
max_size, kCFStringEncodingUTF8)) {
|
||||
dstr_resize(result, strlen(result->array));
|
||||
if (cfstr_copy_dstr(str.get(), kCFStringEncodingUTF8, result))
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
const char *code_str = code_to_str(code);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue