]> git.sesse.net Git - vlc/commitdiff
dynamicoverlay: We need a commanddesc_static_t for non strdup()-ed initializer.
authorPierre d'Herbemont <pdherbemont@free.fr>
Thu, 20 Aug 2009 22:07:11 +0000 (00:07 +0200)
committerPierre d'Herbemont <pdherbemont@free.fr>
Thu, 20 Aug 2009 22:07:11 +0000 (00:07 +0200)
modules/video_filter/dynamicoverlay/dynamicoverlay.h
modules/video_filter/dynamicoverlay/dynamicoverlay_commands.c

index e0818d53adb287eeae4e36340700a20b634f9624..e9058381fa4c33cc505a0959c3597be6522dc68b 100644 (file)
@@ -71,18 +71,29 @@ typedef struct commandparams_t
     bool b_visible; /*< visibility flag of overlay */
 } commandparams_t;
 
+typedef int (*parser_func_t)(char *psz_command, char *psz_end, commandparams_t *p_params );
+typedef int (*execute_func_t)( filter_t *p_filter, const commandparams_t *p_params, commandparams_t *p_results );
+typedef int (*unparse_func_t)( const commandparams_t *p_results, buffer_t *p_output );
+
 typedef struct commanddesc_t
 {
     char *psz_command;
     bool b_atomic;
-    int ( *pf_parser ) ( char *psz_command, char *psz_end,
-                         commandparams_t *p_params );
-    int ( *pf_execute ) ( filter_t *p_filter, const commandparams_t *p_params,
-                          commandparams_t *p_results );
-    int ( *pf_unparse ) ( const commandparams_t *p_results,
-                          buffer_t *p_output );
+    parser_func_t pf_parser;
+    execute_func_t pf_execute;
+    unparse_func_t pf_unparse;
 } commanddesc_t;
 
+typedef struct commanddesc_static_t
+{
+    const char *psz_command;
+    bool b_atomic;
+    parser_func_t pf_parser;
+    execute_func_t pf_execute;
+    unparse_func_t pf_unparse;
+} commanddesc_static_t;
+
+
 typedef struct command_t
 {
     struct commanddesc_t *p_command;
index cee57f154e6a959e579c04f154fe9b24f932dbb7..f8697f21407dfb43852bda3319e1c757228bbc73 100644 (file)
@@ -792,7 +792,7 @@ static int exec_StartAtomic( filter_t *p_filter,
 /*****************************************************************************
  * Command functions
  *****************************************************************************/
-static const commanddesc_t p_commands[] =
+static const commanddesc_static_t p_commands[] =
 {
     {   .psz_command = "DataSharedMem",
         .b_atomic = true,