From: aravind.gara Date: Thu, 8 Sep 2016 10:13:44 +0000 (+0900) Subject: Fix for SVACE defects X-Git-Tag: accepted/tizen/3.0.m2/mobile/20170104.122203^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Faccepted%2Ftizen_3.0_tv;p=platform%2Fcore%2Fapi%2Fsound-pool.git Fix for SVACE defects Change-Id: I4dd3b5f08b91000cab36b6e7d4fe62b125ccb348 Signed-off-by: aravind.gara --- diff --git a/src/soundpool.c b/src/soundpool.c index 2c8707d..bbcd013 100644 --- a/src/soundpool.c +++ b/src/soundpool.c @@ -203,8 +203,6 @@ sound_pool_error_e _sound_pool_activate(sound_pool_t *pool) _sound_stream_priority_update_playback(pool->mgr_priority); - /* Generate array of all AlSources in pool */ - GPtrArray *streams = NULL; if (g_hash_table_size(pool->streams) > 0) { SP_RETVM_IF(!alcMakeContextCurrent(pool->al_context), SOUND_POOL_ERROR_INVALID_OPERATION, "Can't set current context."); @@ -213,9 +211,6 @@ sound_pool_error_e _sound_pool_activate(sound_pool_t *pool) SP_INFO("Resuming [%d] number of streams.", len); } - if (streams) - g_ptr_array_free(streams, TRUE); - SP_INFO("Sound pool has been activated"); if (pool->state_cb_info.callback) @@ -237,8 +232,6 @@ sound_pool_error_e _sound_pool_deactivate(sound_pool_t *pool) sound_pool_state_e old_state = pool->state; pool->state = SOUND_POOL_STATE_INACTIVE; - /* Generate array of all AlSources in pool */ - GPtrArray *streams = NULL; if (g_hash_table_size(pool->streams) > 0) { SP_RETVM_IF(!alcMakeContextCurrent(pool->al_context), SOUND_POOL_ERROR_INVALID_OPERATION, "Can't set current context."); @@ -247,9 +240,6 @@ sound_pool_error_e _sound_pool_deactivate(sound_pool_t *pool) SP_INFO("Suspending [%d] number of streams.", len); } - if (streams) - g_ptr_array_free(streams, TRUE); - SP_INFO("Sound pool has been deactivated"); if (pool->state_cb_info.callback) diff --git a/src/stream.c b/src/stream.c index 878573e..eaae813 100644 --- a/src/stream.c +++ b/src/stream.c @@ -235,6 +235,8 @@ sound_pool_error_e _sound_stream_destroy(sound_stream_t *stream) SP_DEBUG_FENTER(); SP_RETVM_IF(!stream, SOUND_POOL_ERROR_INVALID_PARAMETER, "Can't destroy NULL sound stream"); + SP_RETVM_IF(!stream->parent_source, SOUND_POOL_ERROR_INVALID_PARAMETER, + "Invalid parent source."); SP_RETVM_IF(!stream->parent_source->parent_pool, SOUND_POOL_ERROR_INVALID_PARAMETER, "Empty parent pool pointer."); diff --git a/test/logger/src/logger.c b/test/logger/src/logger.c index d3932ab..c36d74b 100644 --- a/test/logger/src/logger.c +++ b/test/logger/src/logger.c @@ -55,7 +55,6 @@ static struct { pthread_mutex_t mutex; time_t timer; } __logger = { 0, LOG_MODE_NONE, {'\0'}, PTHREAD_MUTEX_INITIALIZER, 0 }; - static char LOGGER_LOG_TAG[MAX_LOG_TAG_LEN] = LOG_TAG; #define MAX_DATETIME_STR_LEN 26 @@ -101,10 +100,12 @@ int _logger_set_log_tag(const char *tag) # define __LOGGER_PREPARE() \ do { \ + struct tm timenew; \ pthread_mutex_lock(&__logger.mutex); \ time(&__logger.timer); \ + localtime_r(&__logger.timer, &timenew); \ strftime(str_time, MAX_DATETIME_STR_LEN, "%Y:%m:%d %H:%M:%S", \ - localtime(&__logger.timer)); \ + &timenew); \ } while (0) # define __LOGGER_UNPREPARE() \ diff --git a/test/proxy/src/proxy.c b/test/proxy/src/proxy.c index 2ea4440..4bb3fe2 100644 --- a/test/proxy/src/proxy.c +++ b/test/proxy/src/proxy.c @@ -1171,10 +1171,6 @@ static int __proxy_sound_pool_stream_set_priority(const char *pars) if (pools[idx] == NULL) _logger_log_warn("Pool with specified identifier is NULL"); - if (rank < 0) - _logger_log_warn("Priority rank should to be greater or equal 0, but " - "it's value is %i", rank); - _logger_log_info(CMD_SET_STREAM_PRIORITY " command was called"); int ret = sound_pool_stream_set_priority(pools[idx], stream_idx, rank); diff --git a/test/sound_pool_test.c b/test/sound_pool_test.c index 2bbe3e6..0295a3a 100644 --- a/test/sound_pool_test.c +++ b/test/sound_pool_test.c @@ -274,7 +274,8 @@ int main(int argc, char* argv[]) } case 't': { int log_mode = LOG_MODE_NONE; - char *token = strtok(optarg, ","); + char *usr_ptr = NULL; + char *token = strtok_r(optarg, ",", &usr_ptr); while (token != NULL) { if (strncmp(token, "stderr", MAX_MSG_LEN) == 0) { @@ -289,7 +290,7 @@ int main(int argc, char* argv[]) "Use one (or combination separated by coma) " "from the list: dlog, stderr, and dlog.\n", token); } - token = strtok(NULL, ", "); + token = strtok_r(NULL, ", ", &usr_ptr); } if (log_mode != LOG_MODE_NONE)