[vlc-commits] plugin: use separate description command for lists and list callbacks

Rémi Denis-Courmont git at videolan.org
Sun Aug 19 23:11:26 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug 19 22:08:50 2012 +0300| [04e363a9459baba69a6906d20c4336b2dbcc21c1] | committer: Rémi Denis-Courmont

plugin: use separate description command for lists and list callbacks

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=04e363a9459baba69a6906d20c4336b2dbcc21c1
---

 include/vlc_plugin.h |   20 ++++++++++++--------
 src/modules/entry.c  |    6 ++++--
 2 files changed, 16 insertions(+), 10 deletions(-)

diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index 49adb53..a3f589d 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -91,13 +91,19 @@ enum vlc_module_properties
     VLC_CONFIG_DESC,
     /* description (args=const char *, const char *, const char *) */
 
-    VLC_CONFIG_LIST,
-    /* possible values list
-     * (args=const char *, size_t, const <type> *, const char *const *) */
+    VLC_CONFIG_LIST_OBSOLETE,
+    /* unused (ignored) */
 
     VLC_CONFIG_ADD_ACTION_OBSOLETE,
     /* unused (ignored) */
 
+    VLC_CONFIG_LIST,
+    /* list of suggested values
+     * (args=size_t, const <type> *, const char *const *) */
+
+    VLC_CONFIG_LIST_CB,
+    /* callback for suggested values (args=size_t (*)(<type> **, char ***)) */
+
     /* Insert new VLC_CONFIG_* here */
 };
 
@@ -473,18 +479,16 @@ VLC_METADATA_EXPORTS
     vlc_config_set (VLC_CONFIG_LIST, \
                     (size_t)(sizeof (list) / sizeof (char *)), \
                     (const char *const *)(list), \
-                    (const char *const *)(list_text), \
-                    (vlc_callback_t)NULL);
+                    (const char *const *)(list_text));
 
 #define change_string_cb( cb ) \
-    vlc_config_set (VLC_CONFIG_LIST, 0, NULL, NULL, (vlc_callback_t)(cb));
+    vlc_config_set (VLC_CONFIG_LIST_CB, (cb));
 
 #define change_integer_list( list, list_text ) \
     vlc_config_set (VLC_CONFIG_LIST, \
                     (size_t)(sizeof (list) / sizeof (int)), \
                     (const int *)(list), \
-                    (const char *const *)(list_text), \
-                    (vlc_callback_t)(NULL));
+                    (const char *const *)(list_text));
 
 #define change_integer_range( minv, maxv ) \
     vlc_config_set (VLC_CONFIG_RANGE, (int64_t)(minv), (int64_t)(maxv));
diff --git a/src/modules/entry.c b/src/modules/entry.c
index a23ea6a..7aba198 100644
--- a/src/modules/entry.c
+++ b/src/modules/entry.c
@@ -417,12 +417,14 @@ static int vlc_plugin_setter (void *plugin, void *tgt, int propid, ...)
                 dtext[len] = NULL;
             }
             item->ppsz_list_text = dtext;
-
             item->i_list = len;
-            item->pf_update_list = va_arg (ap, vlc_callback_t);
             break;
         }
 
+        case VLC_CONFIG_LIST_CB:
+            item->pf_update_list = va_arg (ap, vlc_callback_t);
+            break;
+
         default:
             fprintf (stderr, "LibVLC: unknown module property %d\n", propid);
             fprintf (stderr, "LibVLC: too old to use this module?\n");



More information about the vlc-commits mailing list