]> git.sesse.net Git - vlc/blobdiff - src/video_output/vout_subpictures.c
Remove check for pthread_once - we never used it
[vlc] / src / video_output / vout_subpictures.c
index e4724d8e64b9650319fd36bffb794977d337c818..3b7ff37c35e6a1716a5e63d217782a768d904541 100644 (file)
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
 #include <vlc_vout.h>
 #include <vlc_block.h>
@@ -515,10 +519,21 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
 {
     int i_source_video_width;
     int i_source_video_height;
+    subpicture_t *p_subpic_v = p_subpic;
 
     /* Get lock */
     vlc_mutex_lock( &p_spu->subpicture_lock );
 
+    for( p_subpic_v = p_subpic;
+            p_subpic_v != NULL && p_subpic_v->i_status != FREE_SUBPICTURE;
+            p_subpic_v = p_subpic_v->p_next )
+    {
+        if( p_subpic_v->pf_pre_render )
+        {
+            p_subpic_v->pf_pre_render( p_fmt, p_spu, p_subpic_v, mdate() );
+        }
+    }
+
     if( i_scale_width_orig <= 0 )
         i_scale_width_orig = 1;
     if( i_scale_height_orig <= 0 )
@@ -530,7 +545,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
     /* Check i_status again to make sure spudec hasn't destroyed the subpic */
     while( ( p_subpic != NULL ) && ( p_subpic->i_status != FREE_SUBPICTURE ) )
     {
-        subpicture_region_t *p_region = p_subpic->p_region;
+        subpicture_region_t *p_region;
         int pi_scale_width[ SCALE_SIZE ];
         int pi_scale_height[ SCALE_SIZE ];
         int pi_subpic_x[ SCALE_SIZE ];
@@ -550,6 +565,18 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
         for( k = 0; k < SCALE_SIZE ; k++ )
             pi_subpic_x[ k ] = p_subpic->i_x;
 
+        if( p_subpic->pf_update_regions )
+        {
+            if ( p_subpic->p_region ) {
+                spu_DestroyRegion( p_spu, p_subpic->p_region );
+            }
+            p_subpic->p_region = p_region = p_subpic->pf_update_regions( p_fmt, p_spu, p_subpic, mdate() );
+        }
+        else
+        {
+            p_region = p_subpic->p_region;
+        }
+
         /* Load the blending module */
         if( !p_spu->p_blend && p_region )
         {