Commit cf105ef4 authored by Laurent Aimar's avatar Laurent Aimar

Fixed spu_t attach/detach sequence.

It should fix #2622 (segfault with vout-filter).
parent edc8b8e6
...@@ -271,10 +271,11 @@ vout_thread_t *__vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout, ...@@ -271,10 +271,11 @@ vout_thread_t *__vout_Request( vlc_object_t *p_this, vout_thread_t *p_vout,
{ {
msg_Dbg( p_this, "reusing provided vout" ); msg_Dbg( p_this, "reusing provided vout" );
spu_Attach( p_vout->p_spu, p_this, true ); spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), false );
vlc_object_detach( p_vout ); vlc_object_detach( p_vout );
vlc_object_attach( p_vout, p_this ); vlc_object_attach( p_vout, p_this );
spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), true );
} }
} }
...@@ -418,13 +419,15 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt ) ...@@ -418,13 +419,15 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
/* Initialize subpicture unit */ /* Initialize subpicture unit */
p_vout->p_spu = spu_Create( p_vout ); p_vout->p_spu = spu_Create( p_vout );
spu_Attach( p_vout->p_spu, p_parent, true );
/* Attach the new object now so we can use var inheritance below */ /* Attach the new object now so we can use var inheritance below */
vlc_object_attach( p_vout, p_parent ); vlc_object_attach( p_vout, p_parent );
/* */
spu_Init( p_vout->p_spu ); spu_Init( p_vout->p_spu );
spu_Attach( p_vout->p_spu, VLC_OBJECT(p_vout), true );
/* Take care of some "interface/control" related initialisations */ /* Take care of some "interface/control" related initialisations */
vout_IntfInit( p_vout ); vout_IntfInit( p_vout );
......
...@@ -300,7 +300,8 @@ void spu_Attach( spu_t *p_spu, vlc_object_t *p_this, bool b_attach ) ...@@ -300,7 +300,8 @@ void spu_Attach( spu_t *p_spu, vlc_object_t *p_this, bool b_attach )
vlc_object_t *p_input; vlc_object_t *p_input;
p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_PARENT ); p_input = vlc_object_find( p_this, VLC_OBJECT_INPUT, FIND_PARENT );
if( !p_input ) return; if( !p_input )
return;
if( b_attach ) if( b_attach )
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment