[vlc-devel] commit: Partially fix sub picture filter chain handling. Still needs a bit of (Antoine Cellerier )

git version control git at videolan.org
Tue Jun 10 16:29:40 CEST 2008


vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Tue Jun 10 16:31:30 2008 +0200| [bb03e12e367a4e3a5e8127fd5ebc1a7eb670c4f0]

Partially fix sub picture filter chain handling. Still needs a bit of
work.

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

 src/misc/filter_chain.c             |   14 ++++++++++----
 src/video_output/vout_subpictures.c |   10 ++--------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index a86e031..06c9af7 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -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 );
+    }
 }
 
 
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index daecbee..51ac67f 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -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;




More information about the vlc-devel mailing list