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:
Glenn Kasten
2013-04-03 17:09:24 -07:00
parent 9ce89835da
commit f19395db63

View File

@@ -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) {