mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-06 06:50:43 +09:00
Pipewire audio: set media role to production (hoping for lower latency)
This commit is contained in:
@@ -206,10 +206,13 @@ static pa_handle* pa_sound_device_new(const char *server,
|
|||||||
p->output_length = buffer_size;
|
p->output_length = buffer_size;
|
||||||
p->output_index = 0;
|
p->output_index = 0;
|
||||||
|
|
||||||
|
pa_proplist *proplist = pa_proplist_new();
|
||||||
|
pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "production");
|
||||||
|
|
||||||
if (!(p->mainloop = pa_mainloop_new()))
|
if (!(p->mainloop = pa_mainloop_new()))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (!(p->context = pa_context_new(pa_mainloop_get_api(p->mainloop), name)))
|
if (!(p->context = pa_context_new_with_proplist(pa_mainloop_get_api(p->mainloop), name, proplist)))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (pa_context_connect(p->context, server, PA_CONTEXT_NOFLAGS, NULL) < 0) {
|
if (pa_context_connect(p->context, server, PA_CONTEXT_NOFLAGS, NULL) < 0) {
|
||||||
@@ -239,12 +242,14 @@ static pa_handle* pa_sound_device_new(const char *server,
|
|||||||
if(pa)
|
if(pa)
|
||||||
pa_operation_unref(pa);
|
pa_operation_unref(pa);
|
||||||
|
|
||||||
|
pa_proplist_free(proplist);
|
||||||
return p;
|
return p;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
if (rerror)
|
if (rerror)
|
||||||
*rerror = error;
|
*rerror = error;
|
||||||
pa_sound_device_free(p);
|
pa_sound_device_free(p);
|
||||||
|
pa_proplist_free(proplist);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user