Fix for SVACE defects 16/87516/3 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable accepted/tizen_3.0_common accepted/tizen_3.0_ivi accepted/tizen_3.0_mobile accepted/tizen_3.0_tv accepted/tizen_3.0_wearable accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170104.122203 accepted/tizen/3.0.m2/tv/20170104.122423 accepted/tizen/3.0.m2/wearable/20170104.122816 accepted/tizen/3.0/common/20161114.105317 accepted/tizen/3.0/ivi/20161011.065208 accepted/tizen/3.0/mobile/20161015.034126 accepted/tizen/3.0/tv/20161016.005714 accepted/tizen/3.0/wearable/20161015.084024 accepted/tizen/common/20160921.162220 accepted/tizen/ivi/20160922.042624 accepted/tizen/mobile/20160922.042347 accepted/tizen/tv/20160922.042500 accepted/tizen/unified/20170309.032101 accepted/tizen/wearable/20160922.042546 submit/tizen/20160921.041639 submit/tizen_3.0.m2/20170104.093749 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000007 submit/tizen_3.0_mobile/20161015.000006 submit/tizen_3.0_tv/20161015.000005 submit/tizen_3.0_wearable/20161015.000005 submit/tizen_unified/20170308.100405 tizen_4.0.m1_release
authoraravind.gara <aravind.gara@samsung.com>
Thu, 8 Sep 2016 10:13:44 +0000 (19:13 +0900)
committeraravind.gara <aravind.gara@samsung.com>
Fri, 9 Sep 2016 00:37:51 +0000 (09:37 +0900)
Change-Id: I4dd3b5f08b91000cab36b6e7d4fe62b125ccb348
Signed-off-by: aravind.gara <aravind.gara@samsung.com>
src/soundpool.c
src/stream.c
test/logger/src/logger.c
test/proxy/src/proxy.c
test/sound_pool_test.c

index 2c8707d..bbcd013 100644 (file)
@@ -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)
index 878573e..eaae813 100644 (file)
@@ -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.");
 
index d3932ab..c36d74b 100644 (file)
@@ -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()                                                \
index 2ea4440..4bb3fe2 100644 (file)
@@ -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);
index 2bbe3e6..0295a3a 100644 (file)
@@ -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)