[vlc-commits] decoder: initialize callbacks data before probing the module

Rémi Denis-Courmont git at videolan.org
Sun May 3 16:04:34 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun May  3 17:03:57 2015 +0300| [363541c914c3a63c50122ed527f2867981bbdea6] | committer: Rémi Denis-Courmont

decoder: initialize callbacks data before probing the module

This fixes aout_update_format and vout_update_format.

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

 src/input/decoder.c |   44 ++++++++++++++++++++++----------------------
 1 file changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/input/decoder.c b/src/input/decoder.c
index 68931d4..3fb695f 100644
--- a/src/input/decoder.c
+++ b/src/input/decoder.c
@@ -1511,6 +1511,23 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
     p_owner->p_sout_input = NULL;
     p_owner->p_packetizer = NULL;
     p_owner->b_packetizer = b_packetizer;
+
+    p_owner->b_fmt_description = false;
+    p_owner->p_description = NULL;
+
+    p_owner->b_paused = false;
+    p_owner->pause.i_date = VLC_TS_INVALID;
+    p_owner->pause.i_ignore = 0;
+
+    p_owner->b_waiting = false;
+    p_owner->b_first = true;
+    p_owner->b_has_data = false;
+
+    p_owner->b_flushing = false;
+    p_owner->b_draining = false;
+    p_owner->b_drained = false;
+    p_owner->b_idle = false;
+
     es_format_Init( &p_owner->fmt, UNKNOWN_ES, 0 );
 
     /* decoder fifo */
@@ -1522,6 +1539,11 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
         return NULL;
     }
 
+    vlc_mutex_init( &p_owner->lock );
+    vlc_cond_init( &p_owner->wait_request );
+    vlc_cond_init( &p_owner->wait_acknowledge );
+    vlc_cond_init( &p_owner->wait_fifo );
+
     /* Set buffers allocation callbacks for the decoders */
     p_dec->pf_aout_format_update = aout_update_format;
     p_dec->pf_vout_format_update = vout_update_format;
@@ -1584,28 +1606,6 @@ static decoder_t * CreateDecoder( vlc_object_t *p_parent,
     }
 
     /* */
-    vlc_mutex_init( &p_owner->lock );
-    vlc_cond_init( &p_owner->wait_request );
-    vlc_cond_init( &p_owner->wait_acknowledge );
-    vlc_cond_init( &p_owner->wait_fifo );
-
-    p_owner->b_fmt_description = false;
-    p_owner->p_description = NULL;
-
-    p_owner->b_paused = false;
-    p_owner->pause.i_date = VLC_TS_INVALID;
-    p_owner->pause.i_ignore = 0;
-
-    p_owner->b_waiting = false;
-    p_owner->b_first = true;
-    p_owner->b_has_data = false;
-
-    p_owner->b_flushing = false;
-    p_owner->b_draining = false;
-    p_owner->b_drained = false;
-    p_owner->b_idle = false;
-
-    /* */
     p_owner->cc.b_supported = false;
     if( !b_packetizer )
     {



More information about the vlc-commits mailing list