Merge "AudioTrack: offload is not tied to USAGE_MEDIA" into qt-dev

This commit is contained in:
Jean-Michel Trivi
2019-04-15 21:17:12 +00:00
committed by Android (Google) Code Review

View File

@@ -975,13 +975,9 @@ public class AudioTrack extends PlayerBase
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
"Offload and low latency modes are incompatible"); "Offload and low latency modes are incompatible");
} }
if (mAttributes.getUsage() != AudioAttributes.USAGE_MEDIA) {
throw new UnsupportedOperationException(
"Cannot create AudioTrack, offload requires USAGE_MEDIA");
}
if (!AudioSystem.isOffloadSupported(mFormat, mAttributes)) { if (!AudioSystem.isOffloadSupported(mFormat, mAttributes)) {
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
"Cannot create AudioTrack, offload format not supported"); "Cannot create AudioTrack, offload format / attributes not supported");
} }
} }