summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Naganov <mnaganov@google.com>2019-07-26 21:30:37 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-07-26 21:30:37 -0700
commit815f0f234d64bc7baaf2e33a2823992ffc3eab19 (patch)
tree4ca0c1000bbb8c023d5270ec933362142aad6d9b
parent8a0efbe1579dc8451af1359cb784cd930d7f5440 (diff)
parent0440eb8f0092286a88d944b3e77e0b5727f31add (diff)
downloadlibhardware-815f0f234d64bc7baaf2e33a2823992ffc3eab19.tar.gz
Merge "r_submix: Fix compilation for non-default configurations" am: a5c2957f63 am: fcaa728e9e
am: 0440eb8f00 Change-Id: Ifd2bf5985bfc0b62dd01fecf8ff4364651c7c311
-rw-r--r--modules/audio_remote_submix/audio_hw.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/modules/audio_remote_submix/audio_hw.cpp b/modules/audio_remote_submix/audio_hw.cpp
index 833c12bb..f7786938 100644
--- a/modules/audio_remote_submix/audio_hw.cpp
+++ b/modules/audio_remote_submix/audio_hw.cpp
@@ -472,7 +472,7 @@ static void submix_audio_device_release_pipe_l(struct submix_audio_device * cons
rsxadev->routes[route_idx].rsxSource.clear();
}
memset(rsxadev->routes[route_idx].address, 0, AUDIO_DEVICE_MAX_ADDRESS_LEN);
-#ifdef ENABLE_RESAMPLING
+#if ENABLE_RESAMPLING
memset(rsxadev->routes[route_idx].resampler_buffer, 0,
sizeof(int16_t) * DEFAULT_PIPE_SIZE_IN_FRAMES);
#endif
@@ -499,7 +499,9 @@ static void submix_audio_device_destroy_pipe_l(struct submix_audio_device * cons
}
ALOGV("submix_audio_device_destroy_pipe_l(): input ref_count %d", in->ref_count);
#else
- rsxadev->input = NULL;
+ route_idx = in->route_handle;
+ ALOG_ASSERT(rsxadev->routes[route_idx].input == in);
+ rsxadev->routes[route_idx].input = NULL;
shut_down = true;
#endif // ENABLE_LEGACY_INPUT_OPEN
if (shut_down) {
@@ -1623,7 +1625,9 @@ static int adev_open_input_stream(struct audio_hw_device *dev,
if (!in) {
in = (struct submix_stream_in *)calloc(1, sizeof(struct submix_stream_in));
if (!in) return -ENOMEM;
+#if ENABLE_LEGACY_INPUT_OPEN
in->ref_count = 1;
+#endif
// Initialize the function pointer tables (v-tables).
in->stream.common.get_sample_rate = in_get_sample_rate;
@@ -1714,10 +1718,16 @@ static int adev_dump(const audio_hw_device_t *device, int fd)
int n = snprintf(msg, sizeof(msg), "\nReroute submix audio module:\n");
write(fd, &msg, n);
for (int i=0 ; i < MAX_ROUTES ; i++) {
+#if ENABLE_RESAMPLING
n = snprintf(msg, sizeof(msg), " route[%d] rate in=%d out=%d, addr=[%s]\n", i,
rsxadev->routes[i].config.input_sample_rate,
rsxadev->routes[i].config.output_sample_rate,
rsxadev->routes[i].address);
+#else
+ n = snprintf(msg, sizeof(msg), " route[%d], rate=%d addr=[%s]\n", i,
+ rsxadev->routes[i].config.common.sample_rate,
+ rsxadev->routes[i].address);
+#endif
write(fd, &msg, n);
}
return 0;