Fix AudioTrack.setPlaybackRate() error handling
CTS expects that setPlaybackRate() returns an error for a static buffer AudioTrack that has not yet had any data written to the buffer. Bug: 8181114 Change-Id: I17ba039368468f6ccd1eec5322018bfe420c09c8
This commit is contained in:
@@ -791,7 +791,7 @@ public class AudioTrack
|
||||
* {@link #ERROR_INVALID_OPERATION}
|
||||
*/
|
||||
public int setPlaybackRate(int sampleRateInHz) {
|
||||
if (mState == STATE_UNINITIALIZED) {
|
||||
if (mState != STATE_INITIALIZED) {
|
||||
return ERROR_INVALID_OPERATION;
|
||||
}
|
||||
if (sampleRateInHz <= 0) {
|
||||
|
||||
Reference in New Issue
Block a user