Skip to content

Commit bfbdb08

Browse files
Merge branch streamlabs into obs_merge_31.1.2
2 parents 368570a + 9d13188 commit bfbdb08

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

libobs/media-io/audio-io.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,13 @@ extern "C" {
2929
#define MAX_AUDIO_MIXES 6
3030
#define MAX_AUDIO_CHANNELS 8
3131
#define MAX_DEVICE_INPUT_CHANNELS 64
32+
#ifdef __APPLE__
33+
// Increase audio buffer to eliminate error: Source X is lagging (over by X ms) at max audio buffering. Restarting source audio.
34+
// Users have submitted logs where their audio restarts. Increasing buffer size resolved the issue locally
35+
#define AUDIO_OUTPUT_FRAMES 4096
36+
#else
3237
#define AUDIO_OUTPUT_FRAMES 1024
38+
#endif
3339

3440
#define TOTAL_AUDIO_SIZE (MAX_AUDIO_MIXES * MAX_AUDIO_CHANNELS * AUDIO_OUTPUT_FRAMES * sizeof(float))
3541

plugins/mac-capture/mac-audio.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -484,21 +484,12 @@ static void coreaudio_begin_reconnect(struct coreaudio_data *ca)
484484
// It is better to set the 'reconnecting' status here to avoid desynchronization.
485485
// If the thread creation fails, something is broken anyway.
486486
ca->reconnecting = true;
487-
488-
pthread_attr_t attr;
489-
pthread_attr_init(&attr);
490-
491-
// Set QoS class for high-priority real-time work
492-
// USER_INTERACTIVE is the highest reasonable QoS for audio
493-
pthread_attr_set_qos_class_np(&attr, QOS_CLASS_USER_INTERACTIVE, 0);
494-
ret = pthread_create(&ca->reconnect_thread, &attr, reconnect_thread,
495-
ca);
487+
ret = pthread_create(&ca->reconnect_thread, NULL, reconnect_thread, ca);
496488
if (ret != 0)
497489
blog(LOG_WARNING,
498490
"[coreaudio_begin_reconnect] failed to "
499491
"create thread, error code: %d",
500492
ret);
501-
pthread_attr_destroy(&attr);
502493
}
503494

504495
static OSStatus notification_callback(AudioObjectID id, UInt32 num_addresses,

0 commit comments

Comments
 (0)