* Copyright (C) 2008 the VideoLAN team
* $Id$
*
- * Author: Soren Bog <avacore@videolan.org>
+ * Author: Søren Bøg <avacore@videolan.org>
* Jean-Paul Saman <jpsaman@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
overlay_t *OverlayCreate( void )
{
- overlay_t *p_ovl = malloc( sizeof( overlay_t ) );
+ overlay_t *p_ovl = calloc( 1, sizeof( overlay_t ) );
if( p_ovl == NULL )
return NULL;
- memset( p_ovl, 0, sizeof( overlay_t ) );
p_ovl->i_x = p_ovl->i_y = 0;
p_ovl->i_alpha = 0xFF;
p_ovl->b_active = false;
video_format_Setup( &p_ovl->format, VLC_FOURCC( '\0','\0','\0','\0') , 0, 0,
- VOUT_ASPECT_FACTOR );
+ 1, 1 );
p_ovl->p_fontstyle = text_style_New();
p_ovl->data.p_text = NULL;
int OverlayDestroy( overlay_t *p_ovl )
{
- if( p_ovl->data.p_text != NULL )
- free( p_ovl->data.p_text );
+ free( p_ovl->data.p_text );
text_style_Delete( p_ovl->p_fontstyle );
return VLC_SUCCESS;
if( (p_params->i_height != 1) || (p_params->i_width < 1) )
{
msg_Err( p_filter,
- "Invalid width and/or height. when specifing text height "
+ "Invalid width and/or height. when specifying text height "
"must be 1 and width the number of bytes in the string, "
"including the null terminator" );
return VLC_EGENERIC;
}
video_format_Setup( &p_ovl->format, VLC_CODEC_TEXT,
- 0, 0, 0 );
+ 0, 0, 0, 1 );
p_data = shmat( p_params->i_shmid, NULL, SHM_RDONLY );
if( p_data == NULL )
video_format_Setup( &p_ovl->format, p_params->fourcc,
p_params->i_width, p_params->i_height,
- VOUT_ASPECT_FACTOR );
+ 1, 1 );
if( vout_AllocatePicture( p_filter, p_ovl->data.p_pic,
p_ovl->format.i_chroma, p_params->i_width,
- p_params->i_height, p_ovl->format.i_aspect ) )
+ p_params->i_height,
+ p_ovl->format.i_aspect * p_params->i_height,
+ VOUT_ASPECT_FACTOR * p_params->i_width ) )
{
msg_Err( p_filter, "Unable to allocate picture" );
free( p_ovl->data.p_pic );
/*****************************************************************************
* Command functions
*****************************************************************************/
-static const commanddesc_t p_commands[] =
+static const commanddesc_static_t p_commands[] =
{
{ .psz_command = "DataSharedMem",
.b_atomic = true,