fixup! keysound: fix not to ignore after previous keysound is stopped 83/308783/2 accepted/tizen/7.0/unified/20240402.013008
authorSeungbae Shin <seungbae.shin@samsung.com>
Mon, 1 Apr 2024 04:45:55 +0000 (13:45 +0900)
committerSeungbae Shin <seungbae.shin@samsung.com>
Mon, 1 Apr 2024 04:47:37 +0000 (13:47 +0900)
[Version] 0.14.2
[Issue Type] Bug

Change-Id: I80e8af0c95e62c613600c6e3a6200a74f4f3f1e3

mm_sound_keysound.c
packaging/libmm-sound.spec

index 1d3cbc741688d329330dc4ee85b22de5db6bf288..e1b55347060194d9fb5f4c70efda84a3ce951279 100644 (file)
@@ -140,6 +140,8 @@ static const char* __convert_volume_gain_type_to_string(int volume_gain_type)
 }
 
 #ifndef TIZEN_TV
+static char file_last_played[FILENAME_LEN] = { '\0', };
+static struct timespec ts_last_played = { .tv_sec = 0, .tv_nsec = 0 };
 
 static uint64_t __elapsed_time_us(struct timespec *start, struct timespec *end)
 {
@@ -151,11 +153,8 @@ static uint64_t __elapsed_time_us(struct timespec *start, struct timespec *end)
        return end_us - start_us;
 }
 
-static char file_last_played[FILENAME_LEN] = { '\0', };
-
 static bool __is_interval_too_short(const char *filename)
 {
-       static struct timespec ts_last_played = { .tv_sec = 0, .tv_nsec = 0 };
 
        struct timespec ts_now;
        clock_gettime(CLOCK_MONOTONIC, &ts_now);
@@ -197,8 +196,10 @@ int mm_sound_stop_keysound(const char *filename)
        int ret = MM_SOUND_SIMPLE(filename, 0, NO_PRIORITY,
                                                filename ? PA_SOUND_PLAYER_METHOD_NAME_SIMPLE_STOP : PA_SOUND_PLAYER_METHOD_NAME_SIMPLE_STOP_ALL);
 #ifndef TIZEN_TV
-       if (g_strcmp0(file_last_played, filename) == 0)
+       if (!filename || g_strcmp0(file_last_played, filename) == 0) {
                file_last_played[0] = '\0';
+               memset(&ts_last_played, 0, sizeof(struct timespec));
+       }
 #endif
 
        return ret;
index 51414516361792e4bfe791b7108d7158d2495908..77932ce81a3a62a6603a0d5a9bdbd46ce2e2e27b 100644 (file)
@@ -1,6 +1,6 @@
 Name:       libmm-sound
 Summary:    MMSound Package contains client lib and focus server binary
-Version:    0.14.1
+Version:    0.14.2
 Release:    0
 Group:      System/Libraries
 License:    Apache-2.0