diff --git a/multimedia/audio/audio_cpp_standard/openslesPlayerNdk/ActsOpenslesPlayerNdkTest.cpp b/multimedia/audio/audio_cpp_standard/openslesPlayerNdk/ActsOpenslesPlayerNdkTest.cpp index 06bc551c5b919dee0310cda0e514c9e85b4f14c4..fd1a3f3c65d222a6336f035cbe160c8d547249b3 100644 --- a/multimedia/audio/audio_cpp_standard/openslesPlayerNdk/ActsOpenslesPlayerNdkTest.cpp +++ b/multimedia/audio/audio_cpp_standard/openslesPlayerNdk/ActsOpenslesPlayerNdkTest.cpp @@ -218,6 +218,12 @@ static SLresult OpenSlTestConcurrent() AUDIO_INFO_LOG("OpenSlTestConcurrent outPut Realize result: %{public}lu", result); return result; } + SLuint32 state; + result = (*outputMixObject)->GetState(outputMixObject, &state); + if (SL_RESULT_SUCCESS != result) { + AUDIO_INFO_LOG("OpenSlTestConcurrent outPut GetState result: %{public}lu", result); + return result; + } SLDataLocator_OutputMix slOutputMix = {SL_DATALOCATOR_OUTPUTMIX, outputMixObject}; SLDataSink slSink = {&slOutputMix, nullptr}; @@ -361,6 +367,12 @@ static SLresult PlayerStart(SLPlayItf sPlayItf, SLOHBufferQueueItf sBufferQueueI AUDIO_INFO_LOG("PlayerStart SetPlayState result: %{public}lu", result); return result; } + SLuint32 state = SL_PLAYSTATE_PLAYING; + result = (*playItf)->GetPlayState(sPlayItf, &state); + if (SL_RESULT_SUCCESS != result) { + AUDIO_INFO_LOG("PlayerStart GetPlayState result: %{public}lu", result); + return result; + } if (!feof(wavFile)) { SLuint8* buffer = nullptr; SLuint32 pSize = 0; diff --git a/multimedia/audio/audio_cpp_standard/openslesRecorderNdk/ActsOpenslesRecoderNdkTest.cpp b/multimedia/audio/audio_cpp_standard/openslesRecorderNdk/ActsOpenslesRecoderNdkTest.cpp index fa926966b140c464f8405d54a362466c880b5266..598c0efd9013652e9e617352e3f46a96b371e343 100644 --- a/multimedia/audio/audio_cpp_standard/openslesRecorderNdk/ActsOpenslesRecoderNdkTest.cpp +++ b/multimedia/audio/audio_cpp_standard/openslesRecorderNdk/ActsOpenslesRecoderNdkTest.cpp @@ -180,6 +180,12 @@ static SLresult CaptureStart(SLRecordItf sRecordItf, SLOHBufferQueueItf sBufferQ AUDIO_INFO_LOG("CaptureStart SetRecordState result: %{public}lu", result); return result; } + SLuint32 state = SL_RECORDSTATE_RECORDING; + result = (*recordItf)->GetRecordState(sRecordItf, &state); + if (SL_RESULT_SUCCESS != result) { + AUDIO_INFO_LOG("CaptureStart GetRecordState result: %{public}lu", result); + return result; + } if (wavFile != nullptr) { SLuint8* buffer = nullptr; SLuint32 pSize = 0;