I would like to have some timeout for pulseaudio operation. What's default timeout for operation in pulseaudio library ?
bool wait_operation(pa_operation *_op)
{
using namespace std::chrono;
auto start = steady_clock::now();
decltype(duration_cast<milliseconds>(start - start).count()) dur;
do
{
int operres = pa_operation_get_state(_op);
if (operres == PA_OPERATION_DONE)
return true;
if (operres == PA_OPERATION_CANCELLED)
return false;
auto end = steady_clock::now();
dur = duration_cast<std::chrono::milliseconds>(end - start).count();
pa_threaded_mainloop_wait(m_mloop);
}while(dur < PULSE_OPERATION_TIMEOUT);
return false;
}
op = pa_context_get_sink_info_list(m_ctx, on_dev_sink, udata);
//pa_threaded_mainloop_wait(m_mloop);
if (!wait_operation(op))
{
pa_operation_unref(op);
pa_threaded_mainloop_unlock(m_mloop);
printf("pulse: error operation \n");
return;
}
Can i know how to get pulseaudio operation timeout ?