[vlc-commits] tospdif: use a Close callback in the operations structure

Steve Lhomme git at videolan.org
Mon Oct 12 15:56:02 CEST 2020


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Oct  6 12:03:06 2020 +0200| [1bf9eee46a1e96d4fa67eb72858376945cddecf5] | committer: Steve Lhomme

tospdif: use a Close callback in the operations structure

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

 modules/audio_filter/converter/tospdif.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/modules/audio_filter/converter/tospdif.c b/modules/audio_filter/converter/tospdif.c
index e513e7aa28..5b0e2df8fc 100644
--- a/modules/audio_filter/converter/tospdif.c
+++ b/modules/audio_filter/converter/tospdif.c
@@ -40,14 +40,13 @@
 #include "../../packetizer/dts_header.h"
 
 static int  Open( vlc_object_t * );
-static void Close( vlc_object_t * );
 
 vlc_module_begin ()
     set_category( CAT_AUDIO )
     set_subcategory( SUBCAT_AUDIO_AFILTER )
     set_description( N_("Audio filter for A/52/DTS->S/PDIF encapsulation") )
     set_capability( "audio converter", 10 )
-    set_callbacks( Open, Close )
+    set_callback( Open )
 vlc_module_end ()
 
 typedef struct
@@ -597,6 +596,12 @@ static block_t *DoWork( filter_t *p_filter, block_t *p_in_buf )
     return p_out_buf;
 }
 
+static void Close( filter_t *p_filter )
+{
+    Flush( p_filter );
+    free( p_filter->p_sys );
+}
+
 static int Open( vlc_object_t *p_this )
 {
     filter_t *p_filter = (filter_t *)p_this;
@@ -620,16 +625,9 @@ static int Open( vlc_object_t *p_this )
     {
         .filter_audio = DoWork,
         .flush = Flush,
+        .close = Close,
     };
     p_filter->ops = &filter_ops;
 
     return VLC_SUCCESS;
 }
-
-static void Close( vlc_object_t *p_this )
-{
-    filter_t *p_filter = (filter_t *)p_this;
-
-    Flush( p_filter );
-    free( p_filter->p_sys );
-}



More information about the vlc-commits mailing list