summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2019-03-05 04:16:25 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2019-03-05 04:16:25 +0000
commit0d89fa65fc1c1311c0bd1e8c966230512ab57a39 (patch)
tree71da2daaf1c22098880e9a3bbe0e1aca873d125a
parent417be7aeb46e9f3d52be4160c3bcb903a0e6386f (diff)
parent5b78d419541a4e88077772da82160dfad82561e2 (diff)
downloadlibhardware-0d89fa65fc1c1311c0bd1e8c966230512ab57a39.tar.gz
Snap for 5351881 from 5b78d419541a4e88077772da82160dfad82561e2 to qt-release
Change-Id: I737e342edc0a495319004c28e8f1ea9641ab3a14
-rw-r--r--modules/audio_remote_submix/audio_hw.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/modules/audio_remote_submix/audio_hw.cpp b/modules/audio_remote_submix/audio_hw.cpp
index 8c0c0971..6fac56f0 100644
--- a/modules/audio_remote_submix/audio_hw.cpp
+++ b/modules/audio_remote_submix/audio_hw.cpp
@@ -488,17 +488,26 @@ static void submix_audio_device_destroy_pipe_l(struct submix_audio_device * cons
ALOGV("submix_audio_device_destroy_pipe_l()");
int route_idx = -1;
if (in != NULL) {
+ bool shut_down = false;
#if ENABLE_LEGACY_INPUT_OPEN
const_cast<struct submix_stream_in*>(in)->ref_count--;
route_idx = in->route_handle;
ALOG_ASSERT(rsxadev->routes[route_idx].input == in);
if (in->ref_count == 0) {
rsxadev->routes[route_idx].input = NULL;
+ shut_down = true;
}
ALOGV("submix_audio_device_destroy_pipe_l(): input ref_count %d", in->ref_count);
#else
rsxadev->input = NULL;
+ shut_down = true;
#endif // ENABLE_LEGACY_INPUT_OPEN
+ if (shut_down) {
+ sp <MonoPipe> sink = rsxadev->routes[in->route_handle].rsxSink;
+ if (sink != NULL) {
+ sink->shutdown(true);
+ }
+ }
}
if (out != NULL) {
route_idx = out->route_handle;
@@ -1648,6 +1657,12 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
ALOGV("adev_open_input_stream(): about to create pipe");
submix_audio_device_create_pipe_l(rsxadev, config, DEFAULT_PIPE_SIZE_IN_FRAMES,
DEFAULT_PIPE_PERIOD_COUNT, in, NULL, address, route_idx);
+
+ sp <MonoPipe> sink = rsxadev->routes[route_idx].rsxSink;
+ if (sink != NULL) {
+ sink->shutdown(false);
+ }
+
#if LOG_STREAMS_TO_FILES
if (in->log_fd >= 0) close(in->log_fd);
in->log_fd = open(LOG_STREAM_IN_FILENAME, O_CREAT | O_TRUNC | O_WRONLY,