mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-02 09:01:46 -05:00
Split up pa_alsa_init_proplist into two seperate functions for the card and snd_pcm_t specific parts
This commit is contained in:
parent
a45f971e43
commit
f03a7e43db
4 changed files with 36 additions and 29 deletions
|
|
@ -1142,10 +1142,9 @@ int pa__init(pa_module*m) {
|
|||
use_tsched = FALSE;
|
||||
}
|
||||
|
||||
u = pa_xnew0(struct userdata, 1);
|
||||
m->userdata = u = pa_xnew0(struct userdata, 1);
|
||||
u->core = m->core;
|
||||
u->module = m;
|
||||
m->userdata = u;
|
||||
u->use_mmap = use_mmap;
|
||||
u->use_tsched = use_tsched;
|
||||
u->rtpoll = pa_rtpoll_new();
|
||||
|
|
@ -1266,7 +1265,7 @@ int pa__init(pa_module*m) {
|
|||
pa_source_new_data_set_sample_spec(&data, &ss);
|
||||
pa_source_new_data_set_channel_map(&data, &map);
|
||||
|
||||
pa_alsa_init_proplist(data.proplist, pcm_info);
|
||||
pa_alsa_init_proplist_pcm(data.proplist, pcm_info);
|
||||
pa_proplist_sets(data.proplist, PA_PROP_DEVICE_STRING, u->device_name);
|
||||
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_BUFFER_SIZE, "%lu", (unsigned long) (period_frames * frame_size * nfrags));
|
||||
pa_proplist_setf(data.proplist, PA_PROP_DEVICE_BUFFERING_FRAGMENT_SIZE, "%lu", (unsigned long) (period_frames * frame_size));
|
||||
|
|
@ -1454,10 +1453,8 @@ void pa__done(pa_module*m) {
|
|||
|
||||
pa_assert(m);
|
||||
|
||||
if (!(u = m->userdata)) {
|
||||
pa_alsa_redirect_errors_dec();
|
||||
return;
|
||||
}
|
||||
if (!(u = m->userdata))
|
||||
goto finish;
|
||||
|
||||
if (u->source)
|
||||
pa_source_unlink(u->source);
|
||||
|
|
@ -1495,6 +1492,7 @@ void pa__done(pa_module*m) {
|
|||
pa_xfree(u->device_name);
|
||||
pa_xfree(u);
|
||||
|
||||
finish:
|
||||
snd_config_update_free_global();
|
||||
pa_alsa_redirect_errors_dec();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue