Fix bug the first item in the list gets omitted when resuming 68/249668/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Wed, 16 Dec 2020 06:09:06 +0000 (15:09 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Wed, 16 Dec 2020 06:09:18 +0000 (15:09 +0900)
Change-Id: If77c9727f70f370ad776c8bf673dea4f9a8262f4

plugins/wakeup-manager/src/wakeup_audio_manager.cpp

index c110c01..a33a84c 100644 (file)
@@ -242,11 +242,12 @@ void CAudioManager::streaming_audio_data_thread_func(long long start_time)
                                auto begin = mAudioData.begin();
                                lock.unlock();
                                if (iter == end) {
-                                       iter = begin;
-                               }
-                               lead = iter;
-                               if (lead != end) {
-                                       advance(lead, 1);
+                                       lead = begin;
+                               } else {
+                                       lead = iter;
+                                       if (lead != end) {
+                                               advance(lead, 1);
+                                       }
                                }
                                if (lead != end) {
                                        MWR_LOGD("[INFO] Resume thread");