#define DEFAULT_VOLUME_VALUE 1.0f
-static ALCdevice *device = NULL;
static void __stream_activate_iter(gpointer key, gpointer value,
gpointer user_data);
static void __stream_deactivate_iter(gpointer key, gpointer value,
SP_DEBUG_FLEAVE();
}
-sound_pool_error_e _sound_pool_create(size_t max_streams, sound_pool_t **pool)
+sound_pool_error_e _sound_pool_create(sound_pool_t **pool)
{
SP_DEBUG_FENTER();
- SP_RETVM_IF(max_streams == 0, SOUND_POOL_ERROR_INVALID_PARAMETER,
- "Max streams count should be greater than 0.");
+ SP_INST_CHECK(pool, SOUND_POOL_ERROR_INVALID_PARAMETER);
sound_pool_t *_pool = NULL;
SP_RETVM_IF(!(_pool = g_try_malloc0(sizeof(*_pool))),
"table in sound pool", cfail);
}
- _pool->max_streams = max_streams;
_pool->volume = DEFAULT_VOLUME_VALUE;
_pool->max_stream_index = 0;
_pool->state = SOUND_POOL_STATE_INACTIVE;
sound_pool_state_e old_state = pool->state;
pool->state = SOUND_POOL_STATE_ACTIVE;
- /* Generate array of all AlSources in pool */
- GPtrArray *streams = NULL;
+ _sound_stream_priority_update_playback(pool->mgr_priority);
+
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)