Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions samples/powerplay/src/main/cpp/PowerPlayMultiPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,14 @@ void PowerPlayMultiPlayer::triggerDown(int32_t index, oboe::PerformanceMode perf
const auto isPlayHeadAtStart = mSampleSources[index]->getPlayHeadPosition() == 0;

if (isOffloaded && isPlayHeadAtStart) {
const auto result = mAudioStream->flushFromFrame(FlushFromAccuracy::Undefined, 0);
if (result != Result::OK) {
__android_log_print(ANDROID_LOG_ERROR,
TAG,
"Failed to flush from frame. Error: %s",
convertToText(result.error()));
if (mAudioStream->getFramesWritten() > 0) {
const auto result = mAudioStream->flushFromFrame(FlushFromAccuracy::Undefined, 0);
if (result != Result::OK) {
__android_log_print(ANDROID_LOG_ERROR,
TAG,
"Failed to flush from frame. Error: %s",
convertToText(result.error()));
}
}
}
}
Expand Down