mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-10-29 05:40:23 -04:00
modules: Micro-optimisation for rewind_requested paths
Since some devices can be chatty with regards to how often they return from poll(), this adds a PA_UNLIKELY() to all the the rewind_requested checks in our sink modules to make the general case (no rewind was requested) the fast path.
This commit is contained in:
parent
29f064aa3d
commit
e5953fb0dd
12 changed files with 12 additions and 12 deletions
|
|
@ -1081,7 +1081,7 @@ static void thread_func(void *userdata) {
|
|||
|
||||
if (u->sink && PA_SINK_IS_LINKED(u->sink->thread_info.state)) {
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
if (pollfd) {
|
||||
|
|
|
|||
|
|
@ -229,7 +229,7 @@ static void thread_func(void *userdata) {
|
|||
for (;;) {
|
||||
int ret;
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
if ((ret = pa_rtpoll_run(u->rtpoll, TRUE)) < 0)
|
||||
|
|
|
|||
|
|
@ -665,7 +665,7 @@ static void thread_func(void *userdata) {
|
|||
int ret;
|
||||
|
||||
PA_LLIST_FOREACH(ca_sink, u->sinks) {
|
||||
if (ca_sink->pa_sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(ca_sink->pa_sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(ca_sink->pa_sink, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -305,7 +305,7 @@ static void thread_func(void *userdata) {
|
|||
for (;;) {
|
||||
int ret;
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
/* If no outputs are connected, render some data and drop it immediately. */
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ static void thread_func(void *userdata) {
|
|||
for (;;) {
|
||||
int ret;
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
if (u->rtpoll_item) {
|
||||
|
|
|
|||
|
|
@ -213,7 +213,7 @@ static void thread_func(void *userdata) {
|
|||
if (PA_SINK_IS_OPENED(u->sink->thread_info.state))
|
||||
now = pa_rtclock_now();
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
process_rewind(u, now);
|
||||
|
||||
/* Render some data and drop it immediately */
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ static void thread_func(void *userdata) {
|
|||
|
||||
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
/* Render some data and write it to the fifo */
|
||||
|
|
|
|||
|
|
@ -628,7 +628,7 @@ static void thread_func(void *userdata) {
|
|||
for (;;) {
|
||||
/* Render some data and write it to the dsp */
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
process_rewind(u);
|
||||
|
||||
if (u->sink && PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ static void thread_func(void *userdata) {
|
|||
pa_bool_t need_timer = FALSE;
|
||||
|
||||
if (u->sink) {
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
if (PA_SINK_IS_OPENED(u->sink->thread_info.state)) {
|
||||
|
|
|
|||
|
|
@ -891,7 +891,7 @@ static void thread_func(void *userdata) {
|
|||
|
||||
/* pa_log("loop"); */
|
||||
|
||||
if (u->sink && u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink && u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
/* Render some data and write it to the dsp */
|
||||
|
|
|
|||
|
|
@ -327,7 +327,7 @@ static void thread_func(void *userdata) {
|
|||
for (;;) {
|
||||
int ret;
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
if (u->rtpoll_item) {
|
||||
|
|
|
|||
|
|
@ -338,7 +338,7 @@ static void thread_func(void *userdata) {
|
|||
|
||||
pollfd = pa_rtpoll_item_get_pollfd(u->rtpoll_item, NULL);
|
||||
|
||||
if (u->sink->thread_info.rewind_requested)
|
||||
if (PA_UNLIKELY(u->sink->thread_info.rewind_requested))
|
||||
pa_sink_process_rewind(u->sink, 0);
|
||||
|
||||
/* Render some data and write it to the fifo */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue