Commit 43f8d0ef authored by Sam Hocevar's avatar Sam Hocevar

  * Small optimization in vpar_blocks.c, sparing a few memset() calls.
  * Additional error checking in vout_sdl.c.
  * Minor manpage fix, conforming to Debian policy version 3.5.5.0
    (Closes Debian bug #99561).
parent 1dafba77
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
.\" .sp <n> insert n+1 empty lines .\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7) .\" for manpage-specific macros, see man(7)
.SH NAME .SH NAME
vlc, gvlc, gnome-vlc, kvlc, qvlc \- The VideoLAN Client vlc, gvlc, gnome-vlc, qvlc \- The VideoLAN Client
.SH SYNOPSIS .SH SYNOPSIS
.B vlc .B vlc
.RI [ OPTIONS ] .RI [ OPTIONS ]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_sdl.c: SDL video output display method * vout_sdl.c: SDL video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vout_sdl.c,v 1.55 2001/06/07 22:14:56 sam Exp $ * $Id: vout_sdl.c,v 1.56 2001/07/06 08:43:31 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* Pierre Baillet <oct@zoy.org> * Pierre Baillet <oct@zoy.org>
...@@ -246,6 +246,14 @@ static int vout_Init( vout_thread_t *p_vout ) ...@@ -246,6 +246,14 @@ static int vout_Init( vout_thread_t *p_vout )
main_GetIntVariable( VOUT_HEIGHT_VAR,VOUT_HEIGHT_DEFAULT ), main_GetIntVariable( VOUT_HEIGHT_VAR,VOUT_HEIGHT_DEFAULT ),
SDL_YV12_OVERLAY, SDL_YV12_OVERLAY,
p_vout->p_sys->p_display ); p_vout->p_sys->p_display );
if( p_overlay == NULL )
{
intf_ErrMsg( "vout error: could not create SDL overlay" );
p_vout->b_need_render = 1;
return( 0 );
}
intf_WarnMsg( 2, "vout: YUV acceleration %s", intf_WarnMsg( 2, "vout: YUV acceleration %s",
p_overlay->hw_overlay ? "activated" : "unavailable !" ); p_overlay->hw_overlay ? "activated" : "unavailable !" );
p_vout->b_need_render = !p_overlay->hw_overlay; p_vout->b_need_render = !p_overlay->hw_overlay;
...@@ -537,12 +545,7 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -537,12 +545,7 @@ static void vout_Display( vout_thread_t *p_vout )
SDL_Rect disp; SDL_Rect disp;
if((p_vout->p_sys->p_display != NULL) && !p_vout->p_sys->b_reopen_display) if((p_vout->p_sys->p_display != NULL) && !p_vout->p_sys->b_reopen_display)
{ {
if( p_vout->b_need_render ) if( !p_vout->b_need_render )
{
/* Change display frame */
SDL_Flip( p_vout->p_sys->p_display );
}
else
{ {
/* /*
* p_vout->p_rendered_pic->p_y/u/v contains the YUV buffers to * p_vout->p_rendered_pic->p_y/u/v contains the YUV buffers to
...@@ -558,10 +561,20 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -558,10 +561,20 @@ static void vout_Display( vout_thread_t *p_vout )
SDL_YV12_OVERLAY, SDL_YV12_OVERLAY,
p_vout->p_sys->p_display p_vout->p_sys->p_display
); );
}
if( p_vout->p_sys->p_overlay == NULL )
{
/* Overlay allocation failed, switch back to software mode */
intf_ErrMsg( "vout error: could not create SDL overlay" );
p_vout->b_need_render = 1;
}
else
{
intf_WarnMsg( 2, "vout: YUV acceleration %s", intf_WarnMsg( 2, "vout: YUV acceleration %s",
p_vout->p_sys->p_overlay->hw_overlay p_vout->p_sys->p_overlay->hw_overlay
? "activated" : "unavailable !" ); ? "activated" : "unavailable !" );
}
SDL_LockYUVOverlay(p_vout->p_sys->p_overlay); SDL_LockYUVOverlay(p_vout->p_sys->p_overlay);
/* copy the data into video buffers */ /* copy the data into video buffers */
...@@ -581,14 +594,22 @@ static void vout_Display( vout_thread_t *p_vout ) ...@@ -581,14 +594,22 @@ static void vout_Display( vout_thread_t *p_vout )
p_vout->p_sys->p_overlay->h * p_vout->p_sys->p_overlay->h *
p_vout->p_sys->p_overlay->pitches[2] / 2); p_vout->p_sys->p_overlay->pitches[2] / 2);
disp.w = (&p_vout->p_buffer[p_vout->i_buffer_index])->i_pic_width; #define BUFFER (&p_vout->p_buffer[p_vout->i_buffer_index])
disp.h = (&p_vout->p_buffer[p_vout->i_buffer_index])->i_pic_height; disp.w = BUFFER->i_pic_width;
disp.h = BUFFER->i_pic_height;
#undef BUFFER
disp.x = (p_vout->i_width - disp.w)/2; disp.x = (p_vout->i_width - disp.w)/2;
disp.y = (p_vout->i_height - disp.h)/2; disp.y = (p_vout->i_height - disp.h)/2;
SDL_DisplayYUVOverlay( p_vout->p_sys->p_overlay , &disp ); SDL_DisplayYUVOverlay( p_vout->p_sys->p_overlay , &disp );
SDL_UnlockYUVOverlay(p_vout->p_sys->p_overlay); SDL_UnlockYUVOverlay(p_vout->p_sys->p_overlay);
return;
}
} }
/* Software YUV: change display frame */
SDL_Flip( p_vout->p_sys->p_display );
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vpar_blocks.c : blocks parsing * vpar_blocks.c : blocks parsing
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_blocks.c,v 1.82 2001/06/18 23:42:07 sam Exp $ * $Id: vpar_blocks.c,v 1.83 2001/07/06 08:43:31 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr> * Jean-Marc Dressler <polux@via.ecp.fr>
...@@ -396,6 +396,14 @@ static dct_lookup_t * ppl_dct_tab1[2] = { pl_DCT_tab_ac, pl_DCT_tab0a }; ...@@ -396,6 +396,14 @@ static dct_lookup_t * ppl_dct_tab1[2] = { pl_DCT_tab_ac, pl_DCT_tab0a };
static dct_lookup_t * ppl_dct_tab2[2] = { pl_DCT_tab_ac, pl_DCT_tab_dc }; static dct_lookup_t * ppl_dct_tab2[2] = { pl_DCT_tab_ac, pl_DCT_tab_dc };
/* Replacement for memset( p_table, 0, 8*sizeof( int ) ); */
static __inline__ void bzero8int( void *p_table )
{
((int*)p_table)[0] = ((int*)p_table)[1] =
((int*)p_table)[2] = ((int*)p_table)[3] =
((int*)p_table)[4] = ((int*)p_table)[5] =
((int*)p_table)[6] = ((int*)p_table)[7] = 0;
}
/* /*
* Initialization of lookup tables * Initialization of lookup tables
...@@ -1662,7 +1670,7 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb, ...@@ -1662,7 +1670,7 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
else else
{ {
p_mb->i_mb_type = MB_MOTION_FORWARD; p_mb->i_mb_type = MB_MOTION_FORWARD;
memset( p_mb->pppi_motion_vectors, 0, 8*sizeof(int) ); bzero8int( p_mb->pppi_motion_vectors );
} }
/* Set the field we use for motion compensation */ /* Set the field we use for motion compensation */
...@@ -1811,7 +1819,7 @@ static __inline__ void ParseMacroblock( ...@@ -1811,7 +1819,7 @@ static __inline__ void ParseMacroblock(
if( i_coding_type == P_CODING_TYPE ) if( i_coding_type == P_CODING_TYPE )
{ {
/* Reset motion vector predictors (ISO/IEC 13818-2 7.6.3.4). */ /* Reset motion vector predictors (ISO/IEC 13818-2 7.6.3.4). */
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) ); bzero8int( p_vpar->mb.pppi_pmv );
} }
for( i_mb = i_mb_previous + 1; i_mb < *pi_mb_address; i_mb++ ) for( i_mb = i_mb_previous + 1; i_mb < *pi_mb_address; i_mb++ )
...@@ -1866,8 +1874,8 @@ static __inline__ void ParseMacroblock( ...@@ -1866,8 +1874,8 @@ static __inline__ void ParseMacroblock(
{ {
/* Special No-MC macroblock in P pictures (7.6.3.5). */ /* Special No-MC macroblock in P pictures (7.6.3.5). */
p_mb->i_mb_type |= MB_MOTION_FORWARD; p_mb->i_mb_type |= MB_MOTION_FORWARD;
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) ); bzero8int( p_vpar->mb.pppi_pmv );
memset( p_mb->pppi_motion_vectors, 0, 8*sizeof(int) ); bzero8int( p_mb->pppi_motion_vectors );
p_vpar->mb.i_motion_type = 1 + (i_structure == FRAME_STRUCTURE); p_vpar->mb.i_motion_type = 1 + (i_structure == FRAME_STRUCTURE);
p_mb->ppi_field_select[0][0] = (i_structure == BOTTOM_FIELD); p_mb->ppi_field_select[0][0] = (i_structure == BOTTOM_FIELD);
} }
...@@ -1917,7 +1925,7 @@ static __inline__ void ParseMacroblock( ...@@ -1917,7 +1925,7 @@ static __inline__ void ParseMacroblock(
if( !p_vpar->picture.b_concealment_mv ) if( !p_vpar->picture.b_concealment_mv )
{ {
/* Reset MV predictors. */ /* Reset MV predictors. */
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) ); bzero8int( p_vpar->mb.pppi_pmv );
} }
else else
{ {
...@@ -2031,7 +2039,7 @@ static __inline__ void SliceHeader( vpar_thread_t * p_vpar, ...@@ -2031,7 +2039,7 @@ static __inline__ void SliceHeader( vpar_thread_t * p_vpar,
= 1 << (7 + p_vpar->picture.i_intra_dc_precision); = 1 << (7 + p_vpar->picture.i_intra_dc_precision);
/* Reset motion vector predictors (ISO/IEC 13818-2 7.6.3.4). */ /* Reset motion vector predictors (ISO/IEC 13818-2 7.6.3.4). */
memset( p_vpar->mb.pppi_pmv, 0, 8*sizeof(int) ); bzero8int( p_vpar->mb.pppi_pmv );
do do
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment