]> git.sesse.net Git - vlc/blobdiff - src/video_output/video_output.c
* Mandatory step for video output IV and the audio output quality
[vlc] / src / video_output / video_output.c
index 2ddf26675fd02fdf277357d4c19863d11ea0ac5d..fcae25b41492a2738a6bd159ff0039f8287d7269 100644 (file)
@@ -5,8 +5,9 @@
  * thread, and destroy a previously oppened video output thread.
  *****************************************************************************
  * Copyright (C) 2000 VideoLAN
+ * $Id: video_output.c,v 1.122 2001/05/01 04:18:18 sam Exp $
  *
- * Authors:
+ * Authors: Vincent Seguin <seguin@via.ecp.fr>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -108,8 +109,7 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
     }
 
     /* Choose the best module */
-    p_vout->p_module = module_Need( p_main->p_bank,
-                                    MODULE_CAPABILITY_VOUT, NULL );
+    p_vout->p_module = module_Need( MODULE_CAPABILITY_VOUT, NULL );
 
     if( p_vout->p_module == NULL )
     {
@@ -154,16 +154,17 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
     p_vout->i_bytes_per_pixel     = 2;
     p_vout->f_gamma               = VOUT_GAMMA;
     p_vout->b_need_render         = 1;
-
+    p_vout->b_YCbr                = 0;
+    
     p_vout->b_grayscale           = main_GetIntVariable( VOUT_GRAYSCALE_VAR,
                                                      VOUT_GRAYSCALE_DEFAULT );
     p_vout->b_info                = 0;
     p_vout->b_interface           = 0;
     p_vout->b_scale               = 1;
 
-    intf_DbgMsg( "wished configuration: %dx%d, %d/%d bpp (%d Bpl)",
-                 p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
-                 p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line );
+    intf_WarnMsg( 1, "wished configuration: %dx%d, %d/%d bpp (%d Bpl)",
+                  p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
+                  p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line );
 
     /* Initialize idle screen */
     p_vout->last_display_date   = 0;
@@ -195,16 +196,16 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
      * own error messages */
     if( p_vout->pf_create( p_vout ) )
     {
-        module_Unneed( p_main->p_bank, p_vout->p_module );
+        module_Unneed( p_vout->p_module );
         free( p_vout );
         return( NULL );
     }
-    intf_DbgMsg( "actual configuration: %dx%d, %d/%d bpp (%d Bpl), "
-                 "masks: 0x%x/0x%x/0x%x",
-                 p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
-                 p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line,
-                 p_vout->i_red_mask, p_vout->i_green_mask,
-                 p_vout->i_blue_mask );
+    intf_WarnMsg( 1, "actual configuration: %dx%d, %d/%d bpp (%d Bpl), "
+                  "masks: 0x%x/0x%x/0x%x",
+                  p_vout->i_width, p_vout->i_height, p_vout->i_screen_depth,
+                  p_vout->i_bytes_per_pixel * 8, p_vout->i_bytes_per_line,
+                  p_vout->i_red_mask, p_vout->i_green_mask,
+                  p_vout->i_blue_mask );
 
     /* Calculate shifts from system-updated masks */
     MaskToShift( &p_vout->i_red_lshift, &p_vout->i_red_rshift,
@@ -222,30 +223,16 @@ vout_thread_t * vout_CreateThread   ( int *pi_status )
 
     /* Load fonts - fonts must be initialized after the system method since
      * they may be dependant on screen depth and other thread properties */
-    p_vout->p_default_font = vout_LoadFont( DATA_PATH "/" VOUT_DEFAULT_FONT );
-    if( p_vout->p_default_font == NULL )
-    {
-        p_vout->p_default_font = vout_LoadFont( "share/" VOUT_DEFAULT_FONT );
-    }
+    p_vout->p_default_font = vout_LoadFont( VOUT_DEFAULT_FONT );
     if( p_vout->p_default_font == NULL )
     {
         intf_ErrMsg( "vout error: could not load default font" );
-        p_vout->pf_destroy( p_vout );
-        free( p_vout );
-        return( NULL );
-    }
-    p_vout->p_large_font = vout_LoadFont( DATA_PATH "/" VOUT_LARGE_FONT );
-    if( p_vout->p_large_font == NULL )
-    {
-        p_vout->p_large_font = vout_LoadFont( "share/" VOUT_LARGE_FONT );
     }
+
+    p_vout->p_large_font = vout_LoadFont( VOUT_LARGE_FONT );
     if( p_vout->p_large_font == NULL )
     {
         intf_ErrMsg( "vout error: could not load large font" );
-        vout_UnloadFont( p_vout->p_default_font );
-        p_vout->pf_destroy( p_vout );
-        free( p_vout );
-        return( NULL );
     }
 
     /* Create thread and set locks */
@@ -324,7 +311,7 @@ void vout_DestroyThread( vout_thread_t *p_vout, int *pi_status )
  *****************************************************************************/
 void  vout_DisplaySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
 {
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     char        psz_begin_date[MSTRTIME_MAX_SIZE]; /* buffer for date string */
     char        psz_end_date[MSTRTIME_MAX_SIZE];   /* buffer for date string */
 #endif
@@ -333,7 +320,7 @@ void  vout_DisplaySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
     /* Check if status is valid */
     if( p_subpic->i_status != RESERVED_SUBPICTURE )
     {
-        intf_DbgMsg("error: subpicture %p has invalid status %d", p_subpic,
+        intf_ErrMsg("error: subpicture %p has invalid status %d", p_subpic,
                     p_subpic->i_status );
     }
 #endif
@@ -341,7 +328,7 @@ void  vout_DisplaySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
     /* Remove reservation flag */
     p_subpic->i_status = READY_SUBPICTURE;
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     /* Send subpicture information */
     intf_DbgMsg("subpicture %p: type=%d, begin date=%s, end date=%s",
                 p_subpic, p_subpic->i_type,
@@ -384,7 +371,7 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type,
                  * the best possible case, since no memory allocation needs
                  * to be done */
                 p_vout->p_subpicture[i_subpic].i_status = RESERVED_SUBPICTURE;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
                 intf_DbgMsg("subpicture %p (in destroyed subpicture slot)",
                             &p_vout->p_subpicture[i_subpic] );
 #endif
@@ -431,7 +418,7 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type,
             break;
 #ifdef DEBUG
         default:
-            intf_DbgMsg("error: unknown subpicture type %d", i_type );
+            intf_ErrMsg("error: unknown subpicture type %d", i_type );
             p_free_subpic->p_data   =  NULL;
             break;
 #endif
@@ -460,7 +447,7 @@ subpicture_t *vout_CreateSubPicture( vout_thread_t *p_vout, int i_type,
                          strerror( ENOMEM ) );
         }
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
         intf_DbgMsg("subpicture %p (in free subpicture slot)", p_free_subpic );
 #endif
         vlc_mutex_unlock( &p_vout->subpicture_lock );
@@ -487,14 +474,14 @@ void vout_DestroySubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
    /* Check if status is valid */
    if( p_subpic->i_status != RESERVED_SUBPICTURE )
    {
-       intf_DbgMsg("error: subpicture %p has invalid status %d",
+       intf_ErrMsg("error: subpicture %p has invalid status %d",
                    p_subpic, p_subpic->i_status );
    }
 #endif
 
     p_subpic->i_status = DESTROYED_SUBPICTURE;
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     intf_DbgMsg("subpicture %p", p_subpic);
 #endif
 }
@@ -519,12 +506,12 @@ void  vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
         break;
 #ifdef DEBUG
     default:
-        intf_DbgMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
+        intf_ErrMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
         break;
 #endif
     }
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     intf_DbgMsg("picture %p", p_pic);
 #endif
     vlc_mutex_unlock( &p_vout->picture_lock );
@@ -539,7 +526,7 @@ void  vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 void  vout_DatePicture( vout_thread_t *p_vout, picture_t *p_pic, mtime_t date )
 {
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     char        psz_date[MSTRTIME_MAX_SIZE];                         /* date */
 #endif
 
@@ -555,12 +542,12 @@ void  vout_DatePicture( vout_thread_t *p_vout, picture_t *p_pic, mtime_t date )
         break;
 #ifdef DEBUG
     default:
-        intf_DbgMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
+        intf_ErrMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
         break;
 #endif
     }
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     intf_DbgMsg("picture %p, display date: %s", p_pic, mstrtime( psz_date, p_pic->date) );
 #endif
     vlc_mutex_unlock( &p_vout->picture_lock );
@@ -604,7 +591,7 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
                  * memory allocation needs to be done */
                 p_vout->p_picture[i_picture].i_status = RESERVED_PICTURE;
                 p_vout->i_pictures++;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
                 intf_DbgMsg("picture %p (in destroyed picture slot)",
                             &p_vout->p_picture[i_picture] );
 #endif
@@ -666,7 +653,7 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
             break;
 #ifdef DEBUG
         default:
-            intf_DbgMsg("error: unknown picture type %d", i_type );
+            intf_ErrMsg("error: unknown picture type %d", i_type );
             p_free_picture->p_data   =  NULL;
             break;
 #endif
@@ -681,6 +668,9 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
             p_free_picture->i_width                     = i_width;
             p_free_picture->i_height                    = i_height;
             p_free_picture->i_chroma_width              = i_chroma_width;
+            p_free_picture->i_size                      = i_width * i_height;
+            p_free_picture->i_chroma_size               = i_chroma_width
+                                                            * i_height;
             p_free_picture->i_display_horizontal_offset = 0;
             p_free_picture->i_display_vertical_offset   = 0;
             p_free_picture->i_display_width             = i_width;
@@ -699,7 +689,7 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, int i_type,
                          strerror( ENOMEM ) );
         }
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
         intf_DbgMsg("picture %p (in free picture slot)", p_free_picture );
 #endif
         vlc_mutex_unlock( &p_vout->picture_lock );
@@ -733,14 +723,14 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
         (p_pic->i_status != RESERVED_DATED_PICTURE) &&
         (p_pic->i_status != RESERVED_DISP_PICTURE) )
     {
-        intf_DbgMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
+        intf_ErrMsg("error: picture %p has invalid status %d", p_pic, p_pic->i_status );
     }
 #endif
 
     p_pic->i_status = DESTROYED_PICTURE;
     p_vout->i_pictures--;
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     intf_DbgMsg("picture %p", p_pic);
 #endif
 
@@ -761,7 +751,7 @@ void vout_LinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
     vlc_mutex_lock( &p_vout->picture_lock );
     p_pic->i_refcount++;
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     intf_DbgMsg("picture %p refcount=%d", p_pic, p_pic->i_refcount );
 #endif
 
@@ -778,7 +768,7 @@ void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
     vlc_mutex_lock( &p_vout->picture_lock );
     p_pic->i_refcount--;
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     if( p_pic->i_refcount < 0 )
     {
         intf_DbgMsg("error: refcount < 0");
@@ -792,7 +782,7 @@ void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
         p_vout->i_pictures--;
     }
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     intf_DbgMsg("picture %p refcount=%d", p_pic, p_pic->i_refcount );
 #endif
 
@@ -857,23 +847,23 @@ static int BinaryLog(u32 i)
 
     if(i & 0xffff0000)
     {
-       i_log += 16;
+        i_log += 16;
     }
     if(i & 0xff00ff00)
     {
-       i_log += 8;
+        i_log += 8;
     }
     if(i & 0xf0f0f0f0)
     {
-       i_log += 4;
+        i_log += 4;
     }
     if(i & 0xcccccccc)
     {
-       i_log += 2;
+        i_log += 2;
     }
     if(i & 0xaaaaaaaa)
     {
-       i_log += 1;
+        i_log += 1;
     }
 
     if (i != ((u32)1 << i_log))
@@ -930,14 +920,11 @@ static int InitThread( vout_thread_t *p_vout )
         return( 1 );
     }
 
-    if( p_vout->b_need_render )
+    /* Initialize convertion tables and functions */
+    if( vout_InitYUV( p_vout ) )
     {
-        /* Initialize convertion tables and functions */
-        if( vout_InitYUV( p_vout ) )
-        {
-            intf_ErrMsg("vout error: can't allocate YUV translation tables");
-            return( 1 );
-        }
+        intf_ErrMsg("vout error: can't allocate YUV translation tables");
+        return( 1 );
     }
 
     /* Mark thread as running and return */
@@ -1180,7 +1167,7 @@ static void RunThread( vout_thread_t *p_vout)
         /* On awakening, take back lock and send immediately picture to display,
          * then swap buffers */
         vlc_mutex_lock( &p_vout->change_lock );
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
         intf_DbgMsg( "picture %p, subpicture %p in buffer %d, display=%d", p_pic, p_subpic,
                      p_vout->i_buffer_index, b_display /* && !(p_vout->i_changes & VOUT_NODISPLAY_CHANGE) */ );
 #endif
@@ -1324,7 +1311,7 @@ static void DestroyThread( vout_thread_t *p_vout, int i_status )
     vlc_mutex_destroy( &p_vout->change_lock );
                 
     /* Release the module */
-    module_Unneed( p_main->p_bank, p_vout->p_module );
+    module_Unneed( p_vout->p_module );
 
     /* Free structure */
     free( p_vout );
@@ -1423,7 +1410,7 @@ static void SetBufferArea( vout_thread_t *p_vout, int i_x, int i_y, int i_w, int
         }
         else
         {
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
             intf_DbgMsg("area overflow");
 #endif
             p_buffer->pi_area_end[VOUT_MAX_AREAS - 1] = i_h;
@@ -1447,7 +1434,7 @@ static void SetBufferArea( vout_thread_t *p_vout, int i_x, int i_y, int i_w, int
                  * move all old areas down */
                 if( p_buffer->i_areas == VOUT_MAX_AREAS )
                 {
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
                     intf_DbgMsg("areas overflow");
 #endif
                     p_buffer->pi_area_end[VOUT_MAX_AREAS - 2] = p_buffer->pi_area_end[VOUT_MAX_AREAS - 1];
@@ -1481,7 +1468,7 @@ static void SetBufferArea( vout_thread_t *p_vout, int i_x, int i_y, int i_w, int
             if( i_area_copy != i_area )
             {
                 /* Merge with last possible areas */
-                p_buffer->pi_area_end[i_area] = MAX( i_h, p_buffer->pi_area_end[i_area_copy] );
+                //p_buffer->pi_area_end[i_area] = MAX( i_h, p_buffer->pi_area_end[i_area_copy] );
 
                 /* Shift lower areas upward */
                 i_area_shift = i_area_copy - i_area;
@@ -1622,12 +1609,13 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic )
      */
     for( i_area = 0; i_area < p_buffer->i_areas; i_area++ )
     {
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
         intf_DbgMsg("clearing picture %p area in buffer %d: %d-%d", p_pic,
                     p_vout->i_buffer_index, p_buffer->pi_area_begin[i_area], p_buffer->pi_area_end[i_area] );
 #endif
         i_data_size = (p_buffer->pi_area_end[i_area] - p_buffer->pi_area_begin[i_area] + 1) * p_vout->i_bytes_per_line;
         p_data = (u64*) (p_buffer->p_data + p_vout->i_bytes_per_line * p_buffer->pi_area_begin[i_area]);
+
         for( i_data_index = i_data_size / 256; i_data_index-- ; )
         {
             /* Clear 256 bytes block */
@@ -1669,7 +1657,7 @@ static void SetBufferPicture( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 static void RenderPicture( vout_thread_t *p_vout, picture_t *p_pic )
 {
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     char                psz_date[MSTRTIME_MAX_SIZE];         /* picture date */
     mtime_t             render_time;               /* picture rendering time */
 #endif
@@ -1681,7 +1669,7 @@ static void RenderPicture( vout_thread_t *p_vout, picture_t *p_pic )
     p_pic_data =        p_buffer->p_data +
                         p_buffer->i_pic_x * p_vout->i_bytes_per_pixel +
                         p_buffer->i_pic_y * p_vout->i_bytes_per_line;
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     render_time = mdate();
 #endif
  
@@ -1693,37 +1681,37 @@ static void RenderPicture( vout_thread_t *p_vout, picture_t *p_pic )
     switch( p_pic->i_type )
     {
     case YUV_420_PICTURE:
-        p_vout->yuv.p_Convert420( p_vout, p_pic_data,
-                                  p_pic->p_y, p_pic->p_u, p_pic->p_v,
-                                  p_pic->i_width, p_pic->i_height,
-                                  p_buffer->i_pic_width, p_buffer->i_pic_height,
-                                  p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
-                                  p_pic->i_matrix_coefficients );
+        p_vout->yuv.pf_yuv420( p_vout, p_pic_data,
+                               p_pic->p_y, p_pic->p_u, p_pic->p_v,
+                               p_pic->i_width, p_pic->i_height,
+                               p_buffer->i_pic_width, p_buffer->i_pic_height,
+                               p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
+                               p_pic->i_matrix_coefficients );
         break;
     case YUV_422_PICTURE:
-        p_vout->yuv.p_Convert422( p_vout, p_pic_data,
-                                  p_pic->p_y, p_pic->p_u, p_pic->p_v,
-                                  p_pic->i_width, p_pic->i_height,
-                                  p_buffer->i_pic_width, p_buffer->i_pic_height,
-                                  p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
-                                  p_pic->i_matrix_coefficients );
+        p_vout->yuv.pf_yuv422( p_vout, p_pic_data,
+                               p_pic->p_y, p_pic->p_u, p_pic->p_v,
+                               p_pic->i_width, p_pic->i_height,
+                               p_buffer->i_pic_width, p_buffer->i_pic_height,
+                               p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
+                               p_pic->i_matrix_coefficients );
         break;
     case YUV_444_PICTURE:
-        p_vout->yuv.p_Convert444( p_vout, p_pic_data,
-                                  p_pic->p_y, p_pic->p_u, p_pic->p_v,
-                                  p_pic->i_width, p_pic->i_height,
-                                  p_buffer->i_pic_width, p_buffer->i_pic_height,
-                                  p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
-                                  p_pic->i_matrix_coefficients );
+        p_vout->yuv.pf_yuv444( p_vout, p_pic_data,
+                               p_pic->p_y, p_pic->p_u, p_pic->p_v,
+                               p_pic->i_width, p_pic->i_height,
+                               p_buffer->i_pic_width, p_buffer->i_pic_height,
+                               p_vout->i_bytes_per_line / p_vout->i_bytes_per_pixel,
+                               p_pic->i_matrix_coefficients );
         break;
 #ifdef DEBUG
     default:
-        intf_DbgMsg("error: unknown picture type %d", p_pic->i_type );
+        intf_ErrMsg("error: unknown picture type %d", p_pic->i_type );
         break;
 #endif
     }
 
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     /* Print picture date and rendering time */
     intf_DbgMsg("picture %p rendered in buffer %d (%ld us), display date: %s", p_pic,
                 p_vout->i_buffer_index, (long) (mdate() - render_time),
@@ -1833,12 +1821,14 @@ int RenderSplash( vout_thread_t *p_vout )
  *****************************************************************************/
 int RenderIdle( vout_thread_t *p_vout )
 {
+#if 0
     int         i_x = 0, i_y = 0;                           /* text position */
     int         i_width, i_height;                              /* text size */
-    mtime_t     current_date;                                /* current date */
     int         i_amount = 0;                             /*  amount to draw */
     char *psz_text =    "Waiting for stream";            /* text to display */
     char *psz_wtext =   "[................]";
+#endif
+    mtime_t     current_date;                                /* current date */
 
 
     memset( p_vout->p_buffer[ p_vout->i_buffer_index ].p_data,
@@ -1850,6 +1840,8 @@ int RenderIdle( vout_thread_t *p_vout )
 //            && (current_date - p_vout->last_idle_date) > VOUT_IDLE_DELAY 
     )
     {
+        /* FIXME: idle screen disabled */
+#if 0
         SetBufferPicture( p_vout, NULL );
         vout_TextSize( p_vout->p_large_font, WIDE_TEXT | OUTLINED_TEXT, psz_text,
                        &i_width, &i_height );
@@ -1873,6 +1865,7 @@ int RenderIdle( vout_thread_t *p_vout )
 
             SetBufferArea( p_vout, i_x, i_y, i_width, i_height * 2 );
         }
+#endif
         return( 1 );
     }
     return( 0 );
@@ -1980,7 +1973,7 @@ static void RenderSubPicture( vout_thread_t *p_vout, subpicture_t *p_subpic )
 
 #ifdef DEBUG
         default:
-            intf_DbgMsg( "error: unknown subpicture %p type %d",
+            intf_ErrMsg( "error: unknown subpicture %p type %d",
                          p_subpic, p_subpic->i_type );
 #endif
         }
@@ -2045,7 +2038,7 @@ static void RenderInterface( vout_thread_t *p_vout )
  *****************************************************************************/
 static int Manage( vout_thread_t *p_vout )
 {
-#ifdef DEBUG_VOUT
+#ifdef TRACE_VOUT
     if( p_vout->i_changes )
     {
         intf_DbgMsg("changes: 0x%x (no display: 0x%x)", p_vout->i_changes,