New upstream version 23.2.1+dfsg1
This commit is contained in:
parent
cdc9a9fc87
commit
b14f9eae6d
1017 changed files with 37232 additions and 11111 deletions
|
|
@ -3,23 +3,18 @@
|
|||
|
||||
#include "../../obs-internal.h"
|
||||
#include "../../util/dstr.h"
|
||||
#include "../../util/apple/cfstring-utils.h"
|
||||
|
||||
#include "mac-helpers.h"
|
||||
|
||||
static inline bool cf_to_cstr(CFStringRef ref, char *buf, size_t size)
|
||||
{
|
||||
if (!ref) return false;
|
||||
return (bool)CFStringGetCString(ref, buf, size, kCFStringEncodingUTF8);
|
||||
}
|
||||
|
||||
static bool obs_enum_audio_monitoring_device(obs_enum_audio_device_cb cb,
|
||||
void *data, AudioDeviceID id, bool allow_inputs)
|
||||
{
|
||||
UInt32 size = 0;
|
||||
CFStringRef cf_name = NULL;
|
||||
CFStringRef cf_uid = NULL;
|
||||
char name[1024];
|
||||
char uid[1024];
|
||||
char *name = NULL;
|
||||
char *uid = NULL;
|
||||
OSStatus stat;
|
||||
bool cont = true;
|
||||
|
||||
|
|
@ -46,12 +41,14 @@ static bool obs_enum_audio_monitoring_device(obs_enum_audio_device_cb cb,
|
|||
if (!success(stat, "get audio device name"))
|
||||
goto fail;
|
||||
|
||||
if (!cf_to_cstr(cf_name, name, sizeof(name))) {
|
||||
name = cfstr_copy_cstr(cf_name, kCFStringEncodingUTF8);
|
||||
if (!name) {
|
||||
blog(LOG_WARNING, "%s: failed to convert name", __FUNCTION__);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (!cf_to_cstr(cf_uid, uid, sizeof(uid))) {
|
||||
uid = cfstr_copy_cstr(cf_uid, kCFStringEncodingUTF8);
|
||||
if (!uid) {
|
||||
blog(LOG_WARNING, "%s: failed to convert uid", __FUNCTION__);
|
||||
goto fail;
|
||||
}
|
||||
|
|
@ -59,6 +56,8 @@ static bool obs_enum_audio_monitoring_device(obs_enum_audio_device_cb cb,
|
|||
cont = cb(data, name, uid);
|
||||
|
||||
fail:
|
||||
bfree(name);
|
||||
bfree(uid);
|
||||
if (cf_name)
|
||||
CFRelease(cf_name);
|
||||
if (cf_uid)
|
||||
|
|
|
|||
|
|
@ -307,14 +307,15 @@ int_fast32_t pulseaudio_connect_playback(pa_stream *s, const char *name,
|
|||
return -1;
|
||||
|
||||
size_t dev_len = strlen(name) - 8;
|
||||
char device[dev_len];
|
||||
char *device = bzalloc(dev_len + 1);
|
||||
memcpy(device, name, dev_len);
|
||||
device[dev_len] = '\0';
|
||||
|
||||
pulseaudio_lock();
|
||||
int_fast32_t ret = pa_stream_connect_playback(s, device, attr, flags,
|
||||
NULL, NULL);
|
||||
pulseaudio_unlock();
|
||||
|
||||
bfree(device);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
#pragma once
|
||||
|
||||
#include <windows.h>
|
||||
#include <mmdeviceapi.h>
|
||||
#include <audioclient.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue