}
#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)
{
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);
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;