Commit e72f159f authored by Ludovic Fauvet's avatar Ludovic Fauvet

libvlc: generate libvlc options on playback service creation

This allows the options to be regenerated on ps restart (i.e. after a
settings change).
parent 80fc8013
......@@ -85,32 +85,9 @@ app_create(void *data)
{
LOGD("Lifecycle: app_create");
application *app = data;
char *options;
initialize_system_info();
/* Prepare libvlc options */
if ((options = preferences_get_libvlc_options()) != NULL)
{
if (setenv("EMOTION_LIBVLC_ARGS", options, 0) != 0)
LOGE("Failed setting environment");
LOGD("libvlc options: %s", options);
free(options);
}
else
{
LOGE("Unable to allocate memory");
}
/* Set libvlc-emotion verbosity level */
int eina_log_level = EINA_LOG_LEVELS;
if (preferences_get_bool(PREF_DEVELOPER_VERBOSE, false))
{
// We're in verbose mode
eina_log_level = EINA_LOG_LEVEL_DBG;
}
eina_log_domain_level_set("emotion-libvlc", eina_log_level);
/* */
eina_init();
ecore_evas_init();
......
......@@ -37,6 +37,7 @@
#include "playback_service.h"
#include "media/media_list.h"
#include "preferences/preferences.h"
#include "ui/interface.h"
......@@ -283,6 +284,22 @@ ml_on_media_selected_cb(media_list *p_ml, void *p_user_data, int i_pos,
static Evas_Object *
ps_emotion_create(playback_service *p_ps, Evas *p_evas, bool b_mute_video)
{
char *options;
/* Prepare libvlc options */
if ((options = preferences_get_libvlc_options()) != NULL)
{
unsetenv("EMOTION_LIBVLC_ARGS");
if (setenv("EMOTION_LIBVLC_ARGS", options, 0) != 0)
LOGE("Failed setting environment");
LOGD("libvlc options: %s", options);
free(options);
}
else
{
LOGE("Unable to allocate memory");
}
Evas_Object *p_e = emotion_object_add(p_evas);
if (!p_e)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment