assert(ap->mAudioTrack == 0);
assert(ap->mNumChannels == UNKNOWN_NUMCHANNELS);
assert(ap->mSampleRateMilliHz == UNKNOWN_SAMPLERATE);
- assert(ap->mAndroidObjState == ANDROID_UNINITIALIZED);
+ assert(ap->mAndroidObjState == ANDROID_PREPARING);
+ ap->mAndroidObjState = ANDROID_READY;
object_unlock_exclusive(&ap->mObject);
break;
}
+ // FIXME duplicates an initialization also done by higher level
mp->mAndroidObjState = ANDROID_UNINITIALIZED;
mp->mStreamType = ANDROID_DEFAULT_OUTPUT_STREAM_TYPE;
mp->mSessionId = android::AudioSystem::newAudioSessionId();
/**
* Used to define the states of the OpenSL ES / OpenMAX AL object initialization and preparation
- * with regards to the Android-side of the data
+ * with regards to the Android-side of the data, in particular as affected by the play state.
*/
enum AndroidObjectState {
- ANDROID_UNINITIALIZED = -1,
- ANDROID_PREPARING,
- ANDROID_READY,
- NUM_ANDROID_STATES
+ ANDROID_UNINITIALIZED = -1, // never called SetPlayState(PAUSED or PLAYING)
+ ANDROID_PREPARING, // currently preparing due to first SetPlayState(PAUSED or PLAYING)
+ ANDROID_READY, // preparation has completed, and will not be attempted again
+ // NUM_ANDROID_STATES // unused
};