]> git.sesse.net Git - vlc/commitdiff
. suppression d'un bug cosm�tique dans l'affichage des plugins qui en
authorSam Hocevar <sam@videolan.org>
Sun, 28 May 2000 18:28:42 +0000 (18:28 +0000)
committerSam Hocevar <sam@videolan.org>
Sun, 28 May 2000 18:28:42 +0000 (18:28 +0000)
   plus faisait segfaulter, ce qui n'�tait malheureusement pas top

src/video_output/video_output.c
src/video_output/video_spu.c
src/video_output/video_spu.h

index 944c521c3c95a66b8b0f12081bb5fb79289aacd9..8a2a650b6fa24c234ac5875526366a4a32085313 100644 (file)
@@ -1069,6 +1069,10 @@ last_display_date = display_date;
                     RenderPictureInfo( p_vout, p_pic );
                     RenderInfo( p_vout );
                 }
+                if( p_subpic )
+                {
+                    RenderSubPicture( p_vout, p_subpic );
+                }
             }
 
             /* Remove picture from heap */
@@ -1089,10 +1093,6 @@ last_display_date = display_date;
             {
                 RenderInterface( p_vout );
             }
-            if( b_display && p_subpic )
-            {
-                RenderSubPicture( p_vout, p_subpic );
-            }
 
         }
         else if( p_vout->b_active )        /* idle or interface screen alone */
@@ -1529,7 +1529,7 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic )
     }
 
     /*
-     * Set new picture size - if is is smaller than the previous one, clear
+     * Set new picture size - if it is smaller than the previous one, clear
      * around it. Since picture are centered, only their size is tested.
      */
     if( (p_buffer->i_pic_width > i_pic_width) || (p_buffer->i_pic_height > i_pic_height) )
@@ -1823,7 +1823,9 @@ static void RenderSubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
                 vout_DestroySubPicture( p_vout, p_subpic );
                 break;
             }
-            vout_RenderSPU( p_vout, p_subpic );
+            vout_RenderSPU( &p_vout->p_buffer[ p_vout->i_buffer_index ],
+                            p_subpic, p_vout->i_bytes_per_pixel,
+                            p_vout->i_bytes_per_line );
             break;
         case TEXT_SUBPICTURE:                            /* single line text */
             /* Select default font if not specified */
index f3a0e2deda937e7f53835b1523612f742a151060..862c312264078225948148e484cba520549871c0 100644 (file)
@@ -93,24 +93,19 @@ static int NewLine  ( vout_spu_t *p_vspu, int *i_id );
  *****************************************************************************
  * 
  *****************************************************************************/
-void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic )
+void vout_RenderSPU( vout_buffer_t *p_buffer, subpicture_t *p_subpic,
+                     int i_bytes_per_pixel, int i_bytes_per_line )
 {
     int i_code = 0x00;
     int i_next = 0;
     int i_id = 0;
     int i_color;
-    int i_bytes_per_pixel = p_vout->i_bytes_per_pixel;
-    int i_bytes_per_line = p_vout->i_bytes_per_line;
 
     /* FIXME: we need a way to get this information from the stream */
     #define TARGET_WIDTH     720
     #define TARGET_HEIGHT    576
-    int i_x_scale =
-        ( p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_width << 6 )
-            / TARGET_WIDTH;
-    int i_y_scale =
-        ( p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_height << 6 )
-            / TARGET_HEIGHT;
+    int i_x_scale = ( p_buffer->i_pic_width << 6 ) / TARGET_WIDTH;
+    int i_y_scale = ( p_buffer->i_pic_height << 6 ) / TARGET_HEIGHT;
 
     /* FIXME: fake palette - the real one has to be sought in the .IFO */
     static int p_palette[4] = { 0x0000, 0x0000, 0x5555, 0xffff };
@@ -126,13 +121,10 @@ void vout_RenderSPU( vout_thread_t *p_vout, subpicture_t *p_subpic )
     vspu.y = 0;
     vspu.width = TARGET_WIDTH;
     vspu.height = TARGET_HEIGHT;
-    vspu.p_data = p_vout->p_buffer[ p_vout->i_buffer_index ].p_data
-                    /* go to the picture coordinates */
-                    + p_vout->p_buffer->i_pic_x * p_vout->i_bytes_per_pixel
-                    + p_vout->p_buffer->i_pic_y * p_vout->i_bytes_per_line
-                    /* go to the SPU coordinates */
-                    + p_subpic->i_x * i_bytes_per_pixel
-                    + p_subpic->i_y * i_bytes_per_line;
+    vspu.p_data = p_buffer->p_data
+                    /* add the picture coordinates and the SPU coordinates */
+                    + ( p_buffer->i_pic_x + p_subpic->i_x ) * i_bytes_per_pixel
+                    + ( p_buffer->i_pic_y + p_subpic->i_y ) * i_bytes_per_line;
 
     while( p_from[0] < (byte_t *)p_subpic->p_data
                          + p_subpic->type.spu.i_offset[1] )
index b55e67bce93aa7d01d93fbb840ca9213fb8cec5f..2af744343f1cf69ec45b526db62df07106a786f2 100644 (file)
@@ -23,5 +23,6 @@
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
-void   vout_RenderSPU ( vout_thread_t *p_vout, subpicture_t *p_subpic );
+void   vout_RenderSPU ( vout_buffer_t *p_buffer, subpicture_t *p_subpic,
+                        int i_bytes_per_pixel, int i_bytes_per_line );