return info;
}
-
/* might return NULL */
static char *get_current_audio_file(void)
{
return name;
}
+/* If called as child, mmd_lock must be held */
+static void update_mmd(char *info)
+{
+ PARA_DEBUG_LOG("%s", "updating shared memory area\n");
+ strncpy(mmd->selector_info, info, MMD_INFO_SIZE - 1);
+ mmd->selector_info[MMD_INFO_SIZE - 1] = '\0';
+}
+
+static void refresh_selector_info(void)
+{
+ char *name = get_current_audio_file();
+ char *info;
+
+ if (!name)
+ return;
+ info = get_selector_info(name);
+ free(name);
+ mmd_lock();
+ update_mmd(info);
+ mmd_unlock();
+ free(info);
+}
+
/* list attributes / print database info */
static int com_la_info(int fd, int argc, char *argv[])
{
*/
int com_snp(int fd, int argc, char *argv[])
{
- return com_set(fd, argc, argv);
+ int ret = com_set(fd, argc, argv);
+ if (ret >= 0)
+ refresh_selector_info();
+ return ret;
}
/*
return ret;
}
-/* If called as child, mmd_lock must be held */
-static void update_mmd(char *info)
-{
- PARA_DEBUG_LOG("%s", "updating shared memory area\n");
- strncpy(mmd->selector_info, info, MMD_INFO_SIZE - 1);
- mmd->selector_info[MMD_INFO_SIZE - 1] = '\0';
-}
-
static void update_audio_file_server_handler(char *name)
{
char *info;
return -E_ESCAPE;
ret = update_audio_file(argv[1]);
free(tmp);
+ if (ret >= 0)
+ refresh_selector_info();
return ret;
}
-static void refresh_selector_info(void)
-{
- char *name = get_current_audio_file();
- char *info;
-
- if (!name)
- return;
- info = get_selector_info(name);
- free(name);
- mmd_lock();
- update_mmd(info);
- mmd_unlock();
- free(info);
-}
-
/* select previous / next stream */
static int com_ps_ns(__a_unused int fd, int argc, char *argv[])
{