Commit 3bc1ec7a authored by Sam Hocevar's avatar Sam Hocevar

  * Updated the TODO list.
  * Fixed benny's latest C++ism.
  * Fonts not found are no longer fatal to the video output.
parent 022a6845
...@@ -74,7 +74,7 @@ Description: Full DVD navigation ...@@ -74,7 +74,7 @@ Description: Full DVD navigation
Status: Todo Status: Todo
Task: 0x56 Task: 0x56
Difficulty: Important Difficulty: Hard
Urgency: Normal Urgency: Normal
Description: XVideo video output Description: XVideo video output
XVideo is reported to work a bit better than the SDL wrapper on some XVideo is reported to work a bit better than the SDL wrapper on some
...@@ -141,7 +141,7 @@ Status: Todo ...@@ -141,7 +141,7 @@ Status: Todo
Task: 0x4e Task: 0x4e
Difficulty: Hard Difficulty: Hard
Urgency: High Urgency: Important
Description: Write stream zones support Description: Write stream zones support
For random access we need to know where stream descriptors are valid For random access we need to know where stream descriptors are valid
and reside (essentially DVD plugin). -> Meuuh and reside (essentially DVD plugin). -> Meuuh
...@@ -516,7 +516,7 @@ Description: Rewrite input for Program Stream files ...@@ -516,7 +516,7 @@ Description: Rewrite input for Program Stream files
Currently when we read a PS file, it is first translated to TS Currently when we read a PS file, it is first translated to TS
because we first had only PS support. Now time has come to get because we first had only PS support. Now time has come to get
rid of this ugly kludge and integrate a proper PS input. rid of this ugly kludge and integrate a proper PS input.
Status: Done because of Input II on 5 Dec 2000 (Meuuh) Status: Done 5 Dec 2000 (Meuuh) because of Input II
Task: 0x1f Task: 0x1f
Difficulty: Hard Difficulty: Hard
...@@ -625,7 +625,7 @@ Urgency: Wishlist ...@@ -625,7 +625,7 @@ Urgency: Wishlist
Description: Support MPEG1 timecodes Description: Support MPEG1 timecodes
The vlc can parse an MPEG1 system stream, but the parsed The vlc can parse an MPEG1 system stream, but the parsed
PCR values do not seem to be correct. Check what's wrong. PCR values do not seem to be correct. Check what's wrong.
Status: Done because of Input II on 5 Dec 2000 (Meuuh) Status: Done 5 Dec 2000 (Meuuh) because of Input II
Task: 0x12 Task: 0x12
Difficulty: Medium Difficulty: Medium
...@@ -745,7 +745,7 @@ Description: Optimize video parser ...@@ -745,7 +745,7 @@ Description: Optimize video parser
The video parser has some speed issues currently unexplained: The video parser has some speed issues currently unexplained:
even though most functions are inlined, it keeps eating more even though most functions are inlined, it keeps eating more
CPU than it should. This has to be investigated. CPU than it should. This has to be investigated.
Status: Done because of Input II on 5 Dec 2000 (Meuuh) Status: Done 5 Dec 2000 (Meuuh) because of Input II
Task: 0x05 Task: 0x05
Difficulty: Easy Difficulty: Easy
...@@ -754,7 +754,7 @@ Description: Backport vlms input ...@@ -754,7 +754,7 @@ Description: Backport vlms input
The vlc uses the same file input code as the vlms (VideoLAN The vlc uses the same file input code as the vlms (VideoLAN
Mini Server) which has been much improved. Someone should Mini Server) which has been much improved. Someone should
port modifications done to the vlms back to the vlc. port modifications done to the vlms back to the vlc.
Status: Done because of Input II on 5 Dec 2000 (Meuuh) Status: Done 5 Dec 2000 (Meuuh) because of Input II
Task: 0x04 Task: 0x04
Difficulty: Medium Difficulty: Medium
......
...@@ -58,7 +58,7 @@ ac_help="$ac_help ...@@ -58,7 +58,7 @@ ac_help="$ac_help
ac_help="$ac_help ac_help="$ac_help
--disable-x11 X11 support (default enabled)" --disable-x11 X11 support (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--enable-xvideo XVideo interface support (default disabled)" --disable-xvideo XVideo support (default enabled)"
ac_help="$ac_help ac_help="$ac_help
--enable-alsa Alsa sound drivers support (Only for linux) (default disabled)" --enable-alsa Alsa sound drivers support (Only for linux) (default disabled)"
...@@ -3727,29 +3727,81 @@ fi ...@@ -3727,29 +3727,81 @@ fi
# Check whether --enable-xvideo or --disable-xvideo was given. # Check whether --enable-xvideo or --disable-xvideo was given.
if test "${enable_xvideo+set}" = set; then if test "${enable_xvideo+set}" = set; then
enableval="$enable_xvideo" enableval="$enable_xvideo"
if test x$enable_xvideo = xyes; then :
PLUGINS="${PLUGINS} xvideo" fi
LIB_XVIDEO="-L/usr/X11R6/lib -lX11 -lXext -lXv"
fi if test x$enable_xvideo != xno; then
if test x$x_includes = xNONE; then
x_includes=/usr/X11R6/include
fi
if test x$x_libraries = xNONE; then
x_libraries=/usr/X11R6/lib
fi
saved_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$x_includes"
for ac_hdr in X11/extensions/Xv.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
echo "configure:3747: checking for $ac_hdr" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 3752 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3757: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
eval "ac_cv_header_$ac_safe=yes"
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
eval "ac_cv_header_$ac_safe=no"
fi
rm -f conftest*
fi fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
cat >> confdefs.h <<EOF
#define $ac_tr_hdr 1
EOF
PLUGINS="${PLUGINS} xvideo"
LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
CFLAGS_X11="-I$x_includes"
CPPFLAGS=$saved_CPPFLAGS
else
echo "$ac_t""no" 1>&6
fi
done
fi
# Check whether --enable-alsa or --disable-alsa was given. # Check whether --enable-alsa or --disable-alsa was given.
if test "${enable_alsa+set}" = set; then if test "${enable_alsa+set}" = set; then
enableval="$enable_alsa" enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
echo "configure:3743: checking for sys/asoundlib.h" >&5 echo "configure:3795: checking for sys/asoundlib.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3748 "configure" #line 3800 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:3753: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } { (eval echo configure:3805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3766,7 +3818,7 @@ fi ...@@ -3766,7 +3818,7 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
echo "configure:3770: checking for main in -lasound" >&5 echo "configure:3822: checking for main in -lasound" >&5
ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -3774,14 +3826,14 @@ else ...@@ -3774,14 +3826,14 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS" LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3778 "configure" #line 3830 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
main() main()
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:3785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:3837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
......
...@@ -407,11 +407,23 @@ dnl ...@@ -407,11 +407,23 @@ dnl
dnl XVideo module dnl XVideo module
dnl dnl
AC_ARG_ENABLE(xvideo, AC_ARG_ENABLE(xvideo,
[ --enable-xvideo XVideo interface support (default disabled)], [ --disable-xvideo XVideo support (default enabled)])
[if test x$enable_xvideo = xyes; then if test x$enable_xvideo != xno; then
PLUGINS="${PLUGINS} xvideo" if test x$x_includes = xNONE; then
LIB_XVIDEO="-L/usr/X11R6/lib -lX11 -lXext -lXv" x_includes=/usr/X11R6/include
fi]) fi
if test x$x_libraries = xNONE; then
x_libraries=/usr/X11R6/lib
fi
saved_CPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$x_includes"
AC_CHECK_HEADERS(X11/extensions/Xv.h, [
PLUGINS="${PLUGINS} xvideo"
LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
CFLAGS_X11="-I$x_includes"
]
CPPFLAGS=$saved_CPPFLAGS)
fi
dnl dnl
dnl ALSA module dnl ALSA module
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_xvideo.c: Xvideo video output display method * vout_xvideo.c: Xvideo video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000, 2001 VideoLAN * Copyright (C) 1998, 1999, 2000, 2001 VideoLAN
* $Id: vout_xvideo.c,v 1.9 2001/04/21 22:49:24 sam Exp $ * $Id: vout_xvideo.c,v 1.10 2001/04/25 09:31:14 sam Exp $
* *
* Authors: Shane Harper <shanegh@optusnet.com.au> * Authors: Shane Harper <shanegh@optusnet.com.au>
* Vincent Seguin <seguin@via.ecp.fr> * Vincent Seguin <seguin@via.ecp.fr>
...@@ -201,7 +201,7 @@ static int vout_Probe( probedata_t *p_data ) ...@@ -201,7 +201,7 @@ static int vout_Probe( probedata_t *p_data )
return( 999 ); return( 999 );
} }
return( 90 ); return( 110 );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
* aout_s16.c: 16 bit signed audio output functions * aout_s16.c: 16 bit signed audio output functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN * Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: aout_s16.c,v 1.2 2001/03/21 13:42:34 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* *
...@@ -86,12 +85,23 @@ void aout_S16StereoThread( aout_thread_t * p_aout ) ...@@ -86,12 +85,23 @@ void aout_S16StereoThread( aout_thread_t * p_aout )
} }
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit ); l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
//fprintf(stderr,"l_bytes 1: %li\n",l_bytes);
//fprintf(stderr," playing...\n");
p_aout->date = mdate() + ((((mtime_t)(l_bytes / 4)) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(s16) << (p_aout->b_stereo) == 4 */ p_aout->date = mdate() + ((((mtime_t)(l_bytes / 4)) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(s16) << (p_aout->b_stereo) == 4 */
p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(s16) ); p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(s16) );
//fprintf(stderr,"l_bytes #: %li\n",p_aout->pf_getbufinfo( p_aout, l_buffer_limit ));
if ( l_bytes > (l_buffer_limit * sizeof(s16)) ) if ( l_bytes > (l_buffer_limit * sizeof(s16)) )
{ {
msleep( p_aout->l_msleep ); //fprintf(stderr," sleeping...\n");
msleep( p_aout->l_msleep / 2);
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
//fprintf(stderr,"l_bytes *: %li\n",l_bytes);
msleep( p_aout->l_msleep / 2);
} }
else
//fprintf(stderr," not sleeping.\n");
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
//fprintf(stderr,"l_bytes 2: %li\n\n",l_bytes);
} }
vlc_mutex_lock( &p_aout->fifos_lock ); vlc_mutex_lock( &p_aout->fifos_lock );
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration. * interface, such as message output. See config.h for output configuration.
***************************************************************************** *****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN * Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: intf_msg.c,v 1.29 2001/04/25 06:56:47 benny Exp $ * $Id: intf_msg.c,v 1.30 2001/04/25 09:31:14 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -576,7 +576,17 @@ static void PrintMsg( intf_msg_item_t *p_msg ) ...@@ -576,7 +576,17 @@ static void PrintMsg( intf_msg_item_t *p_msg )
{ {
char psz_date[MSTRTIME_MAX_SIZE]; /* formatted time buffer */ char psz_date[MSTRTIME_MAX_SIZE]; /* formatted time buffer */
int i_msg_len = MSTRTIME_MAX_SIZE + strlen(p_msg->psz_msg) + 200; int i_msg_len = MSTRTIME_MAX_SIZE + strlen(p_msg->psz_msg) + 200;
char psz_msg[i_msg_len]; /* message buffer */ char *psz_msg; /* message buffer */
psz_msg = malloc( sizeof( char ) * i_msg_len );
/* Check if allocation succeeded */
if( psz_msg == NULL )
{
fprintf( stderr, "error: not enough memory for message %s\n",
p_msg->psz_msg );
return;
}
/* Format message - the message is formatted here because in case the log /* Format message - the message is formatted here because in case the log
* file is used, it avoids another format string parsing */ * file is used, it avoids another format string parsing */
...@@ -606,14 +616,6 @@ static void PrintMsg( intf_msg_item_t *p_msg ) ...@@ -606,14 +616,6 @@ static void PrintMsg( intf_msg_item_t *p_msg )
break; break;
} }
/* Check if formatting function succeeded */
if( psz_msg == NULL )
{
fprintf( stderr, "error: can not format message (%s): %s\n",
strerror( errno ), p_msg->psz_msg );
return;
}
/* /*
* Print messages * Print messages
*/ */
...@@ -642,6 +644,9 @@ static void PrintMsg( intf_msg_item_t *p_msg ) ...@@ -642,6 +644,9 @@ static void PrintMsg( intf_msg_item_t *p_msg )
fwrite( "\n", 1, 1, p_main->p_msg->p_log_file ); fwrite( "\n", 1, 1, p_main->p_msg->p_log_file );
} }
#endif #endif
/* Free the message */
free( psz_msg );
} }
#else #else
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* spu_decoder.c : spu decoder thread * spu_decoder.c : spu decoder thread
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: spu_decoder.c,v 1.35 2001/04/06 09:15:48 sam Exp $ * $Id: spu_decoder.c,v 1.36 2001/04/25 09:31:14 sam Exp $
* *
* Authors: Samuel Hocevar <sam@zoy.org> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -303,7 +303,7 @@ static void ParsePacket( spudec_thread_t *p_spudec ) ...@@ -303,7 +303,7 @@ static void ParsePacket( spudec_thread_t *p_spudec )
p_spu->i_width, p_spu->i_height, p_spu->i_x, p_spu->i_y, p_spu->i_width, p_spu->i_height, p_spu->i_x, p_spu->i_y,
p_spu->type.spu.i_offset[0], p_spu->type.spu.i_offset[1] ); p_spu->type.spu.i_offset[0], p_spu->type.spu.i_offset[1] );
/* SPU is finished - we can tell the video output to display it */ /* SPU is finished - we can ask the video output to display it */
vout_DisplaySubPicture( p_spudec->p_vout, p_spu ); vout_DisplaySubPicture( p_spudec->p_vout, p_spu );
/* Clean up */ /* Clean up */
...@@ -352,11 +352,9 @@ static int ParseControlSequences( spudec_thread_t *p_spudec, ...@@ -352,11 +352,9 @@ static int ParseControlSequences( spudec_thread_t *p_spudec,
case SPU_CMD_FORCE_DISPLAY: case SPU_CMD_FORCE_DISPLAY:
/* 00 (force displaying) */ /* 00 (force displaying) */
break; break;
/* FIXME: here we have to calculate dates. It's around /* Convert the dates in seconds to PTS values */
* i_date * 12000 but I don't know how much exactly. */
case SPU_CMD_START_DISPLAY: case SPU_CMD_START_DISPLAY:
/* 01 (start displaying) */ /* 01 (start displaying) */
...@@ -418,12 +416,11 @@ static int ParseControlSequences( spudec_thread_t *p_spudec, ...@@ -418,12 +416,11 @@ static int ParseControlSequences( spudec_thread_t *p_spudec,
case SPU_CMD_END: case SPU_CMD_END:
/* ff (end) */ /* ff (end) */
break; break;
default: default:
/* ?? (unknown command) */ /* xx (unknown command) */
intf_ErrMsg( "spudec error: unknown command 0x%.2x", intf_ErrMsg( "spudec error: unknown command 0x%.2x",
i_command ); i_command );
return( 1 ); return( 1 );
...@@ -466,7 +463,8 @@ static int ParseControlSequences( spudec_thread_t *p_spudec, ...@@ -466,7 +463,8 @@ static int ParseControlSequences( spudec_thread_t *p_spudec,
/* More than one padding byte - this is very strange, but /* More than one padding byte - this is very strange, but
* we can deal with it */ * we can deal with it */
intf_WarnMsg( 2, "spudec warning: %i padding bytes", intf_WarnMsg( 2, "spudec warning: %i padding bytes, we usually "
"get 1 or none",
p_spudec->i_spu_size - i_index ); p_spudec->i_spu_size - i_index );
while( i_index < p_spudec->i_spu_size ) while( i_index < p_spudec->i_spu_size )
...@@ -501,10 +499,11 @@ static int ParseRLE( u8 *p_src, subpicture_t * p_spu ) ...@@ -501,10 +499,11 @@ static int ParseRLE( u8 *p_src, subpicture_t * p_spu )
u16 *p_dest = (u16 *)p_spu->p_data; u16 *p_dest = (u16 *)p_spu->p_data;
/* The subtitles are interlaced, we need two offsets */ /* The subtitles are interlaced, we need two offsets */
unsigned int pi_table[2]; unsigned int pi_table[ 2 ];
unsigned int *pi_offset; unsigned int *pi_offset;
pi_table[0] = p_spu->type.spu.i_offset[0] << 1;
pi_table[1] = p_spu->type.spu.i_offset[1] << 1; pi_table[ 0 ] = p_spu->type.spu.i_offset[ 0 ] << 1;
pi_table[ 1 ] = p_spu->type.spu.i_offset[ 1 ] << 1;
for( i_y = 0 ; i_y < i_height ; i_y++ ) for( i_y = 0 ; i_y < i_height ; i_y++ )
{ {
...@@ -537,8 +536,8 @@ static int ParseRLE( u8 *p_src, subpicture_t * p_spu ) ...@@ -537,8 +536,8 @@ static int ParseRLE( u8 *p_src, subpicture_t * p_spu )
else else
{ {
/* We have a boo boo ! */ /* We have a boo boo ! */
intf_ErrMsg( "spudec error: unknown code %.4x", intf_ErrMsg( "spudec error: unknown RLE code "
i_code ); "0x%.4x", i_code );
return( 1 ); return( 1 );
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread. * thread, and destroy a previously oppened video output thread.
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: video_output.c,v 1.117 2001/03/21 13:42:34 sam Exp $ * $Id: video_output.c,v 1.118 2001/04/25 09:31:14 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -228,19 +228,12 @@ vout_thread_t * vout_CreateThread ( int *pi_status ) ...@@ -228,19 +228,12 @@ vout_thread_t * vout_CreateThread ( int *pi_status )
if( p_vout->p_default_font == NULL ) if( p_vout->p_default_font == NULL )
{ {
intf_ErrMsg( "vout error: could not load default font" ); 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( VOUT_LARGE_FONT ); p_vout->p_large_font = vout_LoadFont( VOUT_LARGE_FONT );
if( p_vout->p_large_font == NULL ) if( p_vout->p_large_font == NULL )
{ {
intf_ErrMsg( "vout error: could not load large font" ); 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 */ /* Create thread and set locks */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* video_text.c : text manipulation functions * video_text.c : text manipulation functions
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * Copyright (C) 1999, 2000 VideoLAN
* $Id: video_text.c,v 1.23 2001/04/12 01:52:45 sam Exp $ * $Id: video_text.c,v 1.24 2001/04/25 09:31:14 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -376,6 +376,12 @@ vout_font_t *vout_LoadFont( const char *psz_name ) ...@@ -376,6 +376,12 @@ vout_font_t *vout_LoadFont( const char *psz_name )
*****************************************************************************/ *****************************************************************************/
void vout_UnloadFont( vout_font_t *p_font ) void vout_UnloadFont( vout_font_t *p_font )
{ {
/* If no font was loaded, do nothing */
if( p_font == NULL )
{
return;
}
intf_DbgMsg( "vout: unloading font %p", p_font ); intf_DbgMsg( "vout: unloading font %p", p_font );
free( p_font->p_data ); free( p_font->p_data );
free( p_font ); free( p_font );
...@@ -389,6 +395,13 @@ void vout_UnloadFont( vout_font_t *p_font ) ...@@ -389,6 +395,13 @@ void vout_UnloadFont( vout_font_t *p_font )
*****************************************************************************/ *****************************************************************************/
void vout_TextSize( vout_font_t *p_font, int i_style, const char *psz_text, int *pi_width, int *pi_height ) void vout_TextSize( vout_font_t *p_font, int i_style, const char *psz_text, int *pi_width, int *pi_height )
{ {
/* If no font was loaded, do nothing */
if( p_font == NULL )
{
*pi_width = *pi_height = 0;
return;
}
switch( p_font->i_type ) switch( p_font->i_type )
{ {
case VOUT_FIXED_FONT: case VOUT_FIXED_FONT:
...@@ -426,6 +439,12 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int ...@@ -426,6 +439,12 @@ void vout_Print( vout_font_t *p_font, byte_t *p_pic, int i_bytes_per_pixel, int
int i_position, i_end; /* current position */ int i_position, i_end; /* current position */
vout_put_byte_t *p_PutByte; /* PutByte function */ vout_put_byte_t *p_PutByte; /* PutByte function */
/* If no font was loaded, do nothing */
if( p_font == NULL )
{
return;
}
/* FIXME: background: can be something else that whole byte ?? */ /* FIXME: background: can be something else that whole byte ?? */
/* Select output function */ /* Select output function */
......
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