From 7bd2a617bc4658fa9c4b14a0d1eeda86ae9ebfd6 Mon Sep 17 00:00:00 2001 From: bodamnam Date: Wed, 29 Mar 2023 09:36:00 +0000 Subject: Fix the infinite loop error in AudioJitterBuffer There is an issue when the AudioJitterBuffer invoke resync method if the time difference is not fix to any statement in the loop in condition of the audio frame is SID and the time difference lower than current jitter buffer size minus 20msec. I fix the infinite loop problem to add escape. Bug: 275635779 Test: Verified multiple voice call test in live network Change-Id: I0a6a47f81444219b1fdf561fa69d080dba4ac5d1 --- .../lib/libimsmedia/core/audio/AudioJitterBuffer.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/AudioJitterBuffer.cpp b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/AudioJitterBuffer.cpp index 64890329..98bf8014 100644 --- a/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/AudioJitterBuffer.cpp +++ b/service/src/com/android/telephony/imsmedia/lib/libimsmedia/core/audio/AudioJitterBuffer.cpp @@ -608,19 +608,15 @@ bool AudioJitterBuffer::Resync(uint32_t currentTime) } else { - if (!IsSID(entry->nBufferSize)) - { - // the first voice frame - mCurrPlayingTS = entry->nTimestamp; - IMLOGD2("[Resync] currTs[%d], delay[%d]", mCurrPlayingTS, timeDiff); - return true; - } - else if (timeDiff > (mCurrJitterBufferSize - 1) * FRAME_INTERVAL) + if (!IsSID(entry->nBufferSize) || + timeDiff > (mCurrJitterBufferSize - 1) * FRAME_INTERVAL) { mCurrPlayingTS = entry->nTimestamp; IMLOGD2("[Resync] currTs[%d], delay[%d]", mCurrPlayingTS, timeDiff); return true; } + + break; } } -- cgit v1.2.3