avformat: set pf_* after everything else in init
authorIlkka Ollakka <ileoo@videolan.org>
Thu, 14 Mar 2013 10:33:17 +0000 (12:33 +0200)
committerIlkka Ollakka <ileoo@videolan.org>
Fri, 15 Mar 2013 10:08:35 +0000 (12:08 +0200)
modules/demux/avformat/mux.c

index d15efe9..a8c4519 100644 (file)
@@ -106,11 +106,6 @@ int OpenMux( vlc_object_t *p_this )
       return VLC_EGENERIC;
     }
 
-    /* Fill p_mux fields */
-    p_mux->pf_control   = Control;
-    p_mux->pf_addstream = AddStream;
-    p_mux->pf_delstream = DelStream;
-    p_mux->pf_mux       = Mux;
     p_mux->p_sys = p_sys = malloc( sizeof( sout_mux_sys_t ) );
     if( !p_sys )
         return VLC_ENOMEM;
@@ -136,6 +131,12 @@ int OpenMux( vlc_object_t *p_this )
     p_sys->b_error = false;
     p_sys->i_initial_dts = 0;
 
+    /* Fill p_mux fields */
+    p_mux->pf_control   = Control;
+    p_mux->pf_addstream = AddStream;
+    p_mux->pf_delstream = DelStream;
+    p_mux->pf_mux       = Mux;
+
     return VLC_SUCCESS;
 }