[vlc-commits] aiff: fix callback init order

Rémi Denis-Courmont git at videolan.org
Thu May 3 10:49:11 CEST 2018


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu May  3 11:45:45 2018 +0300| [a8282e0e47dcc53a7ba97dbca5f05163ade3c7aa] | committer: Rémi Denis-Courmont

aiff: fix callback init order

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

 modules/demux/aiff.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/modules/demux/aiff.c b/modules/demux/aiff.c
index db2e932785..3689016a5e 100644
--- a/modules/demux/aiff.c
+++ b/modules/demux/aiff.c
@@ -104,7 +104,6 @@ static unsigned int GetF80BE( const uint8_t p[10] )
 static int Open( vlc_object_t *p_this )
 {
     demux_t     *p_demux = (demux_t*)p_this;
-    demux_sys_t *p_sys;
 
     const uint8_t *p_peek;
 
@@ -118,7 +117,7 @@ static int Open( vlc_object_t *p_this )
         return VLC_EGENERIC;
 
     /* Fill p_demux field */
-    DEMUX_INIT_COMMON(); p_sys = p_demux->p_sys;
+    demux_sys_t *p_sys = calloc( 1, sizeof (*p_sys) );
     es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 't', 'w', 'o', 's' ) );
     p_sys->i_time = 0;
     p_sys->i_ssnd_pos = -1;
@@ -210,6 +209,10 @@ static int Open( vlc_object_t *p_this )
     /* */
     p_sys->es = es_out_Add( p_demux->out, &p_sys->fmt );
 
+    p_demux->pf_demux = Demux;
+    p_demux->pf_control = Control;
+    p_demux->p_sys = p_sys;
+
     return VLC_SUCCESS;
 
 error:



More information about the vlc-commits mailing list