Fix paused data handling logic 59/274959/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Thu, 12 May 2022 12:46:19 +0000 (21:46 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 12 May 2022 12:46:19 +0000 (21:46 +0900)
commit1be69bfb4f9c7cb24507e9001c3f5a85de24d041
tree39af912b9115368071dd7c8bc681c289b0d22d1f
parent9e29c8f186b21547331db4146dcaf755c181d4e1
Fix paused data handling logic

- Issue:
If sound_data queue is cleared still player thread has reference of the first element of the
sound_data queue, then player thread makes double free problem of sound_data.

- Solution:
Problem is because the player thread tries to destroy the data without ownership of the data. So
This patch makes the player thread has ownership of played sound_data. By this change, player
thread can destroy the data that the thread has its ownership.

Change-Id: Ib3e34f9cc8632458f097edd760da2179471bc864
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/ttsd_data.cpp
server/ttsd_data.h
server/ttsd_player.cpp