diff options
author | Jorge E. Moreira <jemoreira@google.com> | 2021-02-08 17:59:31 -0800 |
---|---|---|
committer | Jorge E. Moreira <jemoreira@google.com> | 2021-02-08 17:59:31 -0800 |
commit | dc2b74a983c1182f9f4e05a8e6e91beb04792c51 (patch) | |
tree | 8c44572911d479dc6dca87dd1cc2e9eca46500ba /cras/src/server/audio_thread.c | |
parent | c8f8b3cd94220d03fcdee753d8fc762224c3d177 (diff) | |
parent | 9668bb7e705f4102e0558c522f1488a966a51826 (diff) | |
download | adhd-dc2b74a983c1182f9f4e05a8e6e91beb04792c51.tar.gz |
Merge branch 'upstream-master'
Change-Id: I25af576b68bcd95ee401067ee798e963f9a96264
Diffstat (limited to 'cras/src/server/audio_thread.c')
-rw-r--r-- | cras/src/server/audio_thread.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/cras/src/server/audio_thread.c b/cras/src/server/audio_thread.c index df713ca5..cd155e82 100644 --- a/cras/src/server/audio_thread.c +++ b/cras/src/server/audio_thread.c @@ -555,8 +555,11 @@ static void append_stream_dump_info(struct audio_debug_info *info, si->runtime_nsec = time_since.tv_nsec; } -/* Handle a message sent to the playback thread */ -static int handle_playback_thread_message(struct audio_thread *thread) +/* Handle a message sent from main thread to the audio thread. + * Returns: + * Error code when reading or sending message fails. + */ +static int handle_audio_thread_message(struct audio_thread *thread) { uint8_t buf[256]; struct audio_thread_msg *msg = (struct audio_thread_msg *)buf; @@ -711,7 +714,7 @@ static int handle_playback_thread_message(struct audio_thread *thread) err = audio_thread_send_response(thread, ret); if (err < 0) return err; - return ret; + return 0; } /* Returns the number of active streams plus the number of active devices. */ @@ -912,7 +915,7 @@ static void *audio_io_thread(void *arg) continue; if (thread->pollfds[0].revents & POLLIN) { - rc = handle_playback_thread_message(thread); + rc = handle_audio_thread_message(thread); if (rc < 0) syslog(LOG_ERR, "handle message %d", rc); } |