[vlc-commits] input: change input_thread_events_cb params

Thomas Guillem git at videolan.org
Fri Aug 31 11:01:34 CEST 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Aug 31 10:50:11 2018 +0200| [92c146a614aebe7412b19553e5b4bbb92a469b44] | committer: Thomas Guillem

input: change input_thread_events_cb params

Move the void *user_data parameter at the end of the function. For consistency,
since most opaque pointers are passed at the end of functions in the VLC code
base.

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

 include/vlc_input.h                             | 7 ++++---
 lib/media_player.c                              | 6 +++---
 modules/misc/fingerprinter.c                    | 4 ++--
 modules/misc/medialibrary/MetadataExtractor.cpp | 5 +++--
 modules/misc/medialibrary/medialibrary.h        | 4 ++--
 modules/services_discovery/mediadirs.c          | 9 +++++----
 src/input/event.c                               | 2 +-
 src/input/var.c                                 | 4 ++--
 src/playlist/thread.c                           | 6 +++---
 src/preparser/preparser.c                       | 4 ++--
 10 files changed, 27 insertions(+), 24 deletions(-)

diff --git a/include/vlc_input.h b/include/vlc_input.h
index cfa2cef215..f865e3a1ef 100644
--- a/include/vlc_input.h
+++ b/include/vlc_input.h
@@ -478,8 +478,9 @@ struct vlc_input_event
     };
 };
 
-typedef void (*input_thread_events_cb)( input_thread_t *input, void *user_data,
-                                        const struct vlc_input_event *event );
+typedef void (*input_thread_events_cb)( input_thread_t *input,
+                                        const struct vlc_input_event *event,
+                                        void *userdata);
 
 /**
  * Input queries
@@ -595,7 +596,7 @@ VLC_API void input_SetTime( input_thread_t *, vlc_tick_t i_time, bool b_fast );
 
 VLC_API void input_SetPosition( input_thread_t *, float f_position, bool b_fast );
 
-VLC_API void input_LegacyEvents(input_thread_t *, void *, const struct vlc_input_event * );
+VLC_API void input_LegacyEvents(input_thread_t *, const struct vlc_input_event *, void * );
 VLC_API void input_LegacyVarInit ( input_thread_t * );
 
 /**
diff --git a/lib/media_player.c b/lib/media_player.c
index c397242a74..e299f823b3 100644
--- a/lib/media_player.c
+++ b/lib/media_player.c
@@ -963,8 +963,8 @@ static void del_es_callbacks( input_thread_t *p_input_thread, libvlc_media_playe
     var_DelListCallback( p_input_thread, "spu-es", input_es_changed, p_mi );
 }
 
-static void on_input_event(input_thread_t *input, void *userdata,
-                           const struct vlc_input_event *event)
+static void on_input_event(input_thread_t *input,
+                           const struct vlc_input_event *event, void *userdata)
 {
     if (event->type == INPUT_EVENT_SUBITEMS)
     {
@@ -973,7 +973,7 @@ static void on_input_event(input_thread_t *input, void *userdata,
         libvlc_media_add_subtree(media, event->subitems);
     }
 
-    input_LegacyEvents(input, userdata, event);
+    input_LegacyEvents(input, event, userdata);
 }
 
 /**************************************************************************
diff --git a/modules/misc/fingerprinter.c b/modules/misc/fingerprinter.c
index ade56a9319..c11475a96f 100644
--- a/modules/misc/fingerprinter.c
+++ b/modules/misc/fingerprinter.c
@@ -128,8 +128,8 @@ static void ApplyResult( fingerprint_request_t *p_r, size_t i_resultid )
     vlc_mutex_unlock( &p_item->lock );
 }
 
-static void InputEvent( input_thread_t *p_input, void *p_user_data,
-                        const struct vlc_input_event *p_event )
+static void InputEvent( input_thread_t *p_input,
+                        const struct vlc_input_event *p_event, void *p_user_data )
 {
     VLC_UNUSED( p_input );
     fingerprinter_sys_t *p_sys = p_user_data;
diff --git a/modules/misc/medialibrary/MetadataExtractor.cpp b/modules/misc/medialibrary/MetadataExtractor.cpp
index 3ff3bb19ff..c7a5edf95b 100644
--- a/modules/misc/medialibrary/MetadataExtractor.cpp
+++ b/modules/misc/medialibrary/MetadataExtractor.cpp
@@ -128,8 +128,9 @@ void MetadataExtractor::populateItem( medialibrary::parser::IItem& item, input_i
     }
 }
 
-void MetadataExtractor::onInputEvent( input_thread_t*, void *data,
-                                     const struct vlc_input_event *event )
+void MetadataExtractor::onInputEvent( input_thread_t*,
+                                      const struct vlc_input_event *event,
+                                      void *data )
 {
     auto* ctx = static_cast<ParseContext*>( data );
     ctx->mde->onInputEvent( event, *ctx );
diff --git a/modules/misc/medialibrary/medialibrary.h b/modules/misc/medialibrary/medialibrary.h
index 133ca0f30c..1949682fda 100644
--- a/modules/misc/medialibrary/medialibrary.h
+++ b/modules/misc/medialibrary/medialibrary.h
@@ -85,8 +85,8 @@ private:
     void addSubtree( ParseContext& ctx, input_item_node_t *root );
     void populateItem( medialibrary::parser::IItem& item, input_item_t* inputItem );
 
-    static void onInputEvent( input_thread_t *input, void *user_data,
-                               const struct vlc_input_event *event );
+    static void onInputEvent( input_thread_t *input,
+                              const struct vlc_input_event *event, void *user_data );
 
 private:
     vlc_object_t* m_obj;
diff --git a/modules/services_discovery/mediadirs.c b/modules/services_discovery/mediadirs.c
index f09481d64e..2e9fae845f 100644
--- a/modules/services_discovery/mediadirs.c
+++ b/modules/services_discovery/mediadirs.c
@@ -97,8 +97,8 @@ vlc_module_end ()
 
 static void* Run( void* );
 
-static void on_input_thread_event(input_thread_t *input, void *userdata,
-                                  const struct vlc_input_event *event);
+static void on_input_thread_event(input_thread_t *input,
+                                  const struct vlc_input_event *event, void *userdata);
 
 static int onNewFileAdded( vlc_object_t*, char const *,
                            vlc_value_t, vlc_value_t, void *);
@@ -256,8 +256,9 @@ static void input_item_subtree_added(input_item_t *input_item,
     }
 }
 
-static void on_input_thread_event(input_thread_t *input, void *userdata,
-                                  const struct vlc_input_event *event)
+static void on_input_thread_event(input_thread_t *input,
+                                  const struct vlc_input_event *event,
+                                  void *userdata)
 {
     if (event->type == INPUT_EVENT_SUBITEMS)
         input_item_subtree_added(input_GetItem(input), event->subitems, userdata);
diff --git a/src/input/event.c b/src/input/event.c
index b6c88529d2..12bbe7f9f8 100644
--- a/src/input/event.c
+++ b/src/input/event.c
@@ -39,7 +39,7 @@ static void input_SendEvent( input_thread_t *p_input,
 {
     input_thread_private_t *priv = input_priv(p_input);
     if( priv->events_cb )
-        priv->events_cb( p_input, priv->events_data, event );
+        priv->events_cb( p_input, event, priv->events_data );
 }
 
 void input_SendEventDead( input_thread_t *p_input )
diff --git a/src/input/var.c b/src/input/var.c
index ca0901b69c..bd36c1ad87 100644
--- a/src/input/var.c
+++ b/src/input/var.c
@@ -245,8 +245,8 @@ static inline bool EsFmtIsTeletext( const es_format_t *p_fmt )
     return p_fmt->i_cat == SPU_ES && p_fmt->i_codec == VLC_CODEC_TELETEXT;
 }
 
-void input_LegacyEvents( input_thread_t *p_input, void *user_data,
-                         const struct vlc_input_event *event )
+void input_LegacyEvents( input_thread_t *p_input,
+                         const struct vlc_input_event *event, void *user_data )
 {
     (void) user_data;
     vlc_value_t val;
diff --git a/src/playlist/thread.c b/src/playlist/thread.c
index bc53135d1a..5f9700c4c8 100644
--- a/src/playlist/thread.c
+++ b/src/playlist/thread.c
@@ -185,8 +185,8 @@ void ResetCurrentlyPlaying( playlist_t *p_playlist,
     p_sys->b_reset_currently_playing = false;
 }
 
-static void on_input_event(input_thread_t *input, void *userdata,
-                           const struct vlc_input_event *event)
+static void on_input_event(input_thread_t *input,
+                           const struct vlc_input_event *event, void *userdata)
 {
     if (event->type == INPUT_EVENT_SUBITEMS)
     {
@@ -195,7 +195,7 @@ static void on_input_event(input_thread_t *input, void *userdata,
         playlist_AddSubtree(playlist, item, event->subitems);
     }
 
-    input_LegacyEvents(input, userdata, event);
+    input_LegacyEvents(input, event, userdata);
 }
 
 /**
diff --git a/src/preparser/preparser.c b/src/preparser/preparser.c
index 9e1e5c1b20..f4c9a62053 100644
--- a/src/preparser/preparser.c
+++ b/src/preparser/preparser.c
@@ -90,8 +90,8 @@ static void ReqRelease(input_preparser_req_t *req)
     }
 }
 
-static void InputEvent( input_thread_t *input, void *task_,
-                        const struct vlc_input_event *event )
+static void InputEvent( input_thread_t *input,
+                        const struct vlc_input_event *event, void *task_ )
 {
     VLC_UNUSED( input );
     input_preparser_task_t* task = task_;



More information about the vlc-commits mailing list