[vlc-commits] autodel: reorder to avoid forward declarations

Rémi Denis-Courmont git at videolan.org
Sun Apr 19 13:17:29 CEST 2020


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Apr 19 14:06:18 2020 +0300| [267bd383f9d377a06e28e08637b808dbbbda6c21] | committer: Rémi Denis-Courmont

autodel: reorder to avoid forward declarations

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

 modules/stream_out/autodel.c | 90 ++++++++++++++++++--------------------------
 1 file changed, 37 insertions(+), 53 deletions(-)

diff --git a/modules/stream_out/autodel.c b/modules/stream_out/autodel.c
index 8b0291309c..866dd2134f 100644
--- a/modules/stream_out/autodel.c
+++ b/modules/stream_out/autodel.c
@@ -33,26 +33,6 @@
 #include <vlc_sout.h>
 #include <vlc_block.h>
 
-/*****************************************************************************
- * Module descriptor
- *****************************************************************************/
-static int  Open    ( vlc_object_t * );
-static void Close   ( vlc_object_t * );
-
-#define SOUT_CFG_PREFIX "sout-autodel-"
-
-vlc_module_begin ()
-    set_shortname( N_("Autodel"))
-    set_description( N_("Automatically add/delete input streams"))
-    set_capability( "sout filter", 50 )
-    add_shortcut( "autodel" )
-    set_callbacks( Open, Close )
-vlc_module_end ()
-
-
-/*****************************************************************************
- * Local prototypes
- *****************************************************************************/
 static void *Add( sout_stream_t *, const es_format_t * );
 static void  Del( sout_stream_t *, void * );
 static int   Send( sout_stream_t *, void *, block_t * );
@@ -72,39 +52,6 @@ typedef struct
     int i_es_num;
 } sout_stream_sys_t;
 
-/*****************************************************************************
- * Open:
- *****************************************************************************/
-static int Open( vlc_object_t *p_this )
-{
-    sout_stream_t     *p_stream = (sout_stream_t*)p_this;
-    sout_stream_sys_t *p_sys;
-
-    p_sys          = malloc( sizeof( sout_stream_sys_t ) );
-
-    p_sys->pp_es = NULL;
-    p_sys->i_es_num = 0;
-
-    p_stream->pf_add    = Add;
-    p_stream->pf_del    = Del;
-    p_stream->pf_send   = Send;
-
-    p_stream->p_sys     = p_sys;
-
-    return VLC_SUCCESS;
-}
-
-/*****************************************************************************
- * Close:
- *****************************************************************************/
-static void Close( vlc_object_t * p_this )
-{
-    sout_stream_t     *p_stream = (sout_stream_t*)p_this;
-    sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
-
-    free( p_sys );
-}
-
 static void *Add( sout_stream_t *p_stream, const es_format_t *p_fmt )
 {
     sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
@@ -173,3 +120,40 @@ static int Send( sout_stream_t *p_stream, void *_p_es, block_t *p_buffer )
 
     return VLC_SUCCESS;
 }
+
+static int Open( vlc_object_t *p_this )
+{
+    sout_stream_t     *p_stream = (sout_stream_t*)p_this;
+    sout_stream_sys_t *p_sys;
+
+    p_sys          = malloc( sizeof( sout_stream_sys_t ) );
+
+    p_sys->pp_es = NULL;
+    p_sys->i_es_num = 0;
+
+    p_stream->pf_add    = Add;
+    p_stream->pf_del    = Del;
+    p_stream->pf_send   = Send;
+
+    p_stream->p_sys     = p_sys;
+
+    return VLC_SUCCESS;
+}
+
+static void Close( vlc_object_t * p_this )
+{
+    sout_stream_t     *p_stream = (sout_stream_t*)p_this;
+    sout_stream_sys_t *p_sys = (sout_stream_sys_t *)p_stream->p_sys;
+
+    free( p_sys );
+}
+
+#define SOUT_CFG_PREFIX "sout-autodel-"
+
+vlc_module_begin()
+    set_shortname(N_("Autodel"))
+    set_description(N_("Automatically add/delete input streams"))
+    set_capability("sout filter", 50)
+    add_shortcut("autodel")
+    set_callbacks(Open, Close)
+vlc_module_end()



More information about the vlc-commits mailing list