]> git.sesse.net Git - vlc/commitdiff
+ vout_subpictures.c: don't check only the first subpicture_t to see
authorEric Petit <titer@videolan.org>
Wed, 1 Sep 2004 18:59:23 +0000 (18:59 +0000)
committerEric Petit <titer@videolan.org>
Wed, 1 Sep 2004 18:59:23 +0000 (18:59 +0000)
   if we need blending & rendering modules (fixes text messages which
   were missing sometimes)

src/video_output/vout_subpictures.c

index 4f12c37b55cac7c963807f3daf7c20988704f227..89e0afeff0bcf417618d6fd9081b397f521ac5b0 100644 (file)
@@ -364,44 +364,6 @@ void vout_DestroySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
 void vout_RenderSubPictures( vout_thread_t *p_vout, picture_t *p_pic_dst,
                              picture_t *p_pic_src, subpicture_t *p_subpic )
 {
-    /* Load the blending module */
-    if( !p_vout->p_blend && p_subpic && p_subpic->p_region )
-    {
-        p_vout->p_blend = vlc_object_create( p_vout, sizeof(filter_t) );
-        vlc_object_attach( p_vout->p_blend, p_vout );
-        p_vout->p_blend->fmt_out.video.i_x_offset =
-            p_vout->p_blend->fmt_out.video.i_y_offset = 0;
-        p_vout->p_blend->fmt_out.video.i_aspect =
-            p_vout->render.i_aspect;
-        p_vout->p_blend->fmt_out.video.i_chroma =
-            p_vout->output.i_chroma;
-
-        p_vout->p_blend->fmt_in.video.i_chroma = VLC_FOURCC('Y','U','V','P');
-
-        p_vout->p_blend->p_module =
-            module_Need( p_vout->p_blend, "video blending", 0, 0 );
-    }
-
-    /* Load the text rendering module */
-    if( !p_vout->p_text && p_subpic && p_subpic->p_region )
-    {
-        p_vout->p_text = vlc_object_create( p_vout, sizeof(filter_t) );
-        vlc_object_attach( p_vout->p_text, p_vout );
-
-        p_vout->p_text->fmt_out.video.i_width =
-            p_vout->p_text->fmt_out.video.i_visible_width =
-                p_vout->output.i_width;
-        p_vout->p_text->fmt_out.video.i_height =
-            p_vout->p_text->fmt_out.video.i_visible_height =
-                p_vout->output.i_height;
-
-        p_vout->p_text->pf_spu_buffer_new = spu_new_buffer;
-        p_vout->p_text->pf_spu_buffer_del = spu_del_buffer;
-
-        p_vout->p_text->p_module =
-            module_Need( p_vout->p_text, "text renderer", 0, 0 );
-    }
-
     /* Get lock */
     vlc_mutex_lock( &p_vout->subpicture_lock );
 
@@ -410,6 +372,44 @@ void vout_RenderSubPictures( vout_thread_t *p_vout, picture_t *p_pic_dst,
     {
         subpicture_region_t *p_region = p_subpic->p_region;
 
+        /* Load the blending module */
+        if( !p_vout->p_blend && p_region )
+        {
+            p_vout->p_blend = vlc_object_create( p_vout, sizeof(filter_t) );
+            vlc_object_attach( p_vout->p_blend, p_vout );
+            p_vout->p_blend->fmt_out.video.i_x_offset =
+                p_vout->p_blend->fmt_out.video.i_y_offset = 0;
+            p_vout->p_blend->fmt_out.video.i_aspect =
+                p_vout->render.i_aspect;
+            p_vout->p_blend->fmt_out.video.i_chroma =
+                p_vout->output.i_chroma;
+    
+            p_vout->p_blend->fmt_in.video.i_chroma = VLC_FOURCC('Y','U','V','P');
+    
+            p_vout->p_blend->p_module =
+                module_Need( p_vout->p_blend, "video blending", 0, 0 );
+        }
+    
+        /* Load the text rendering module */
+        if( !p_vout->p_text && p_region )
+        {
+            p_vout->p_text = vlc_object_create( p_vout, sizeof(filter_t) );
+            vlc_object_attach( p_vout->p_text, p_vout );
+    
+            p_vout->p_text->fmt_out.video.i_width =
+                p_vout->p_text->fmt_out.video.i_visible_width =
+                    p_vout->output.i_width;
+            p_vout->p_text->fmt_out.video.i_height =
+                p_vout->p_text->fmt_out.video.i_visible_height =
+                    p_vout->output.i_height;
+    
+            p_vout->p_text->pf_spu_buffer_new = spu_new_buffer;
+            p_vout->p_text->pf_spu_buffer_del = spu_del_buffer;
+    
+            p_vout->p_text->p_module =
+                module_Need( p_vout->p_text, "text renderer", 0, 0 );
+        }
+
         if( p_subpic->pf_render )
         {
             p_subpic->pf_render( p_vout, p_pic_dst, p_subpic );