aaudio: return error code when sample rate rejected
This will prevent us from trying to configure the
FlowGraph with invalid parameters.
The bug occurs when media_audio >> Enable Sample Rate Conversion
flag is turned off.
Bug: 316971461
Test: See bug for repro steps.
Test: If fixed then you should not see the message:
Test: Channel reduction not supported.
Change-Id: I886d334e2b04a8df71e1e8e67498caa3efc9d7cc
diff --git a/media/libaaudio/src/client/AudioStreamInternal.cpp b/media/libaaudio/src/client/AudioStreamInternal.cpp
index 52925d9..7648e25 100644
--- a/media/libaaudio/src/client/AudioStreamInternal.cpp
+++ b/media/libaaudio/src/client/AudioStreamInternal.cpp
@@ -199,6 +199,7 @@
if (getSampleRate() != getDeviceSampleRate()) {
ALOGD("%s - skipping sample rate converter. SR = %d, Device SR = %d", __func__,
getSampleRate(), getDeviceSampleRate());
+ result = AAUDIO_ERROR_INVALID_RATE;
goto error;
}
}