_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.");
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)
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.");
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)
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.");
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
# 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() \
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);
}
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) {
"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)