Partially fix sub picture filter chain handling. Still needs a bit of
authorAntoine Cellerier <dionoea@videolan.org>
Tue, 10 Jun 2008 14:31:30 +0000 (16:31 +0200)
committerAntoine Cellerier <dionoea@videolan.org>
Tue, 10 Jun 2008 14:31:30 +0000 (16:31 +0200)
work.

src/misc/filter_chain.c
src/video_output/vout_subpictures.c

index a86e031..06c9af7 100644 (file)
@@ -95,10 +95,16 @@ void filter_chain_Reset( filter_chain_t *p_chain, const es_format_t *p_fmt_in,
     while( p_chain->filters.i_count )
         filter_chain_DeleteFilter( p_chain,
                                    (filter_t*)p_chain->filters.pp_elems[0] );
-    es_format_Clean( &p_chain->fmt_in );
-    es_format_Clean( &p_chain->fmt_out );
-    es_format_Copy( &p_chain->fmt_in, p_fmt_in );
-    es_format_Copy( &p_chain->fmt_out, p_fmt_out );
+    if( p_fmt_in )
+    {
+        es_format_Clean( &p_chain->fmt_in );
+        es_format_Copy( &p_chain->fmt_in, p_fmt_in );
+    }
+    if( p_fmt_out )
+    {
+        es_format_Clean( &p_chain->fmt_out );
+        es_format_Copy( &p_chain->fmt_out, p_fmt_out );
+    }
 }
 
 
index daecbee..51ac67f 100644 (file)
@@ -54,7 +54,6 @@ static picture_t *spu_new_video_buffer( filter_t * );
 static void spu_del_video_buffer( filter_t *, picture_t * );
 
 static int spu_ParseChain( spu_t * );
-static void spu_DeleteChain( spu_t * );
 static int SubFilterCallback( vlc_object_t *, char const *,
                               vlc_value_t, vlc_value_t, void * );
 
@@ -189,17 +188,12 @@ void spu_Destroy( spu_t *p_spu )
         vlc_object_release( p_spu->p_scale );
     }
 
-    spu_DeleteChain( p_spu );
+    filter_chain_Delete( p_spu->p_chain );
 
     vlc_mutex_destroy( &p_spu->subpicture_lock );
     vlc_object_release( p_spu );
 }
 
-static void spu_DeleteChain( spu_t *p_spu )
-{
-    filter_chain_Delete( p_spu->p_chain );
-}
-
 /**
  * Attach/Detach the SPU from any input
  *
@@ -1345,7 +1339,7 @@ static int SubFilterCallback( vlc_object_t *p_object, char const *psz_var,
 
     spu_t *p_spu = (spu_t *)p_data;
     vlc_mutex_lock( &p_spu->subpicture_lock );
-    spu_DeleteChain( p_spu );
+    filter_chain_Reset( p_spu->p_chain, NULL, NULL );
     spu_ParseChain( p_spu );
     vlc_mutex_unlock( &p_spu->subpicture_lock );
     return VLC_SUCCESS;