]> git.sesse.net Git - vlc/commitdiff
raw*: initialize callbacks only at success
authorRémi Denis-Courmont <remi@remlab.net>
Wed, 20 Feb 2013 21:40:01 +0000 (23:40 +0200)
committerRémi Denis-Courmont <remi@remlab.net>
Wed, 20 Feb 2013 21:40:01 +0000 (23:40 +0200)
Also remove dated comment.

modules/demux/rawaud.c
modules/demux/rawdv.c
modules/demux/rawvid.c

index a638777993fb59c9c9719dd1e99a662b0399c6cf..9dd6da644b8f0cc0c8670b799b8aaa6ecfbc3cb2 100644 (file)
@@ -103,9 +103,6 @@ static int Open( vlc_object_t * p_this )
     demux_t     *p_demux = (demux_t*)p_this;
     demux_sys_t *p_sys;
 
-    /* Set p_input field */
-    p_demux->pf_demux   = Demux;
-    p_demux->pf_control = Control;
     p_demux->p_sys      = p_sys = malloc( sizeof( demux_sys_t ) );
     if( !p_sys )
         return VLC_ENOMEM;
@@ -210,6 +207,8 @@ static int Open( vlc_object_t * p_this )
     p_sys->i_frame_size = p_sys->i_frame_samples * p_sys->i_seek_step;
     msg_Dbg( p_demux, "frame size is %d bytes ", p_sys->i_frame_size);
 
+    p_demux->pf_demux   = Demux;
+    p_demux->pf_control = Control;
     return VLC_SUCCESS;
 }
 
index 043cce43331e2e04f09f6b5f6e89b8045d99db4a..62c4a1502e7e68b37eefb14d7720774f831735ad 100644 (file)
@@ -194,9 +194,6 @@ static int Open( vlc_object_t * p_this )
 
     p_peek += 72;                                  /* skip rest of DIF block */
 
-    /* Set p_input field */
-    p_demux->pf_demux   = Demux;
-    p_demux->pf_control = Control;
     p_demux->p_sys      = p_sys = malloc( sizeof( demux_sys_t ) );
     if( !p_sys )
         return VLC_ENOMEM;
@@ -236,6 +233,8 @@ static int Open( vlc_object_t * p_this )
         p_sys->p_es_audio = es_out_Add( p_demux->out, &p_sys->fmt_audio );
     }
 
+    p_demux->pf_demux   = Demux;
+    p_demux->pf_control = Control;
     return VLC_SUCCESS;
 }
 
index 13761de9c1ca17576b058f0fd45f04fdf5405367..7577b5a199e464e57e9bfae1a2df82f7e1c78136 100644 (file)
@@ -169,9 +169,6 @@ static int Open( vlc_object_t * p_this )
         return VLC_EGENERIC;
     }
 valid:
-    /* Set p_input field */
-    p_demux->pf_demux   = Demux;
-    p_demux->pf_control = Control;
     p_demux->p_sys      = p_sys = malloc( sizeof( demux_sys_t ) );
     if( !p_sys )
         return VLC_ENOMEM;
@@ -388,6 +385,8 @@ valid:
                         * p_sys->fmt_video.video.i_bits_per_pixel / 8;
     p_sys->p_es_video = es_out_Add( p_demux->out, &p_sys->fmt_video );
 
+    p_demux->pf_demux   = Demux;
+    p_demux->pf_control = Control;
     return VLC_SUCCESS;
 
 error: