tone-player: Adds unlinked variable when a stream is stopped 68/233668/2
authorJaechul Lee <jcsing.lee@samsung.com>
Mon, 18 May 2020 06:44:24 +0000 (15:44 +0900)
committerJaechul Lee <jcsing.lee@samsung.com>
Mon, 18 May 2020 07:01:25 +0000 (16:01 +0900)
Unlink messages is sent twice in a row in I/O thread. So, it make
sink_input_kill function call twice without a guard on TM1.

[Version] 13.0.16
[Issue Type] Bugs

Change-Id: Ibbe3041a64107ce4fdcf842658a472aad3c23d02
Signed-off-by: Jaechul Lee <jcsing.lee@samsung.com>
packaging/pulseaudio-modules-tizen.spec
src/module-tone-player.c

index 9a56089..0cab8a7 100644 (file)
@@ -1,6 +1,6 @@
 Name:             pulseaudio-modules-tizen
 Summary:          Pulseaudio modules for Tizen
-Version:          13.0.15
+Version:          13.0.16
 Release:          0
 Group:            Multimedia/Audio
 License:          LGPL-2.1+
index f4a64c9..99866ec 100644 (file)
@@ -100,6 +100,7 @@ struct tone {
     uint16_t loop;
     uint32_t sample;
     bool silence;
+    bool unlinked;
 };
 
 inline uint32_t tone_msec_to_bytes(uint16_t msec) {
@@ -226,9 +227,10 @@ static int sink_input_pop_cb(pa_sink_input *i, size_t length, pa_memchunk *chunk
         return -1;
 
     if (tone_peek_fixed_size(t, i, chunk, length) < 0) {
-        if (pa_sink_input_safe_to_remove(i)) {
+        if (pa_sink_input_safe_to_remove(i) && !t->unlinked) {
             pa_asyncmsgq_post(pa_thread_mq_get()->outq, PA_MSGOBJECT(i),
                                 TONE_SOUND_MESSAGE_UNLINK, NULL, 0, NULL, NULL);
+            t->unlinked = true;
         }
         return -1;
     }