Commit a701094d authored by Sam Hocevar's avatar Sam Hocevar

  * ./plugins/dsp/aout_dsp.c: OpenBSD compilation fix.
  * ./src/video_output/video_output.c: fixed a segfault on exit.
parent 7f76c7c5
This diff is collapsed.
...@@ -212,7 +212,6 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[ ...@@ -212,7 +212,6 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
dnl Check for headers dnl Check for headers
AC_CHECK_HEADERS(getopt.h strings.h) AC_CHECK_HEADERS(getopt.h strings.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h) AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
AC_CHECK_HEADERS(dlfcn.h image.h) AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h) AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
AC_CHECK_HEADERS(machine/param.h sys/shm.h) AC_CHECK_HEADERS(machine/param.h sys/shm.h)
...@@ -1018,7 +1017,7 @@ AC_ARG_ENABLE(dsp, ...@@ -1018,7 +1017,7 @@ AC_ARG_ENABLE(dsp,
if test x$enable_dsp != xno && if test x$enable_dsp != xno &&
(test x$SYS != xmingw32 || test x$enable_dsp = xyes) (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
then then
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h, [ AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
PLUGINS="${PLUGINS} dsp" PLUGINS="${PLUGINS} dsp"
]) ])
fi fi
......
...@@ -259,6 +259,9 @@ ...@@ -259,6 +259,9 @@
/* Define if you have the <pthread.h> header file. */ /* Define if you have the <pthread.h> header file. */
#undef HAVE_PTHREAD_H #undef HAVE_PTHREAD_H
/* Define if you have the <soundcard.h> header file. */
#undef HAVE_SOUNDCARD_H
/* Define if you have the <stddef.h> header file. */ /* Define if you have the <stddef.h> header file. */
#undef HAVE_STDDEF_H #undef HAVE_STDDEF_H
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* aout_dsp.c : dsp functions library * aout_dsp.c : dsp functions library
***************************************************************************** *****************************************************************************
* Copyright (C) 1999-2001 VideoLAN * Copyright (C) 1999-2001 VideoLAN
* $Id: aout_dsp.c,v 1.24 2002/02/24 22:12:10 sam Exp $ * $Id: aout_dsp.c,v 1.25 2002/02/27 18:19:21 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -43,17 +43,18 @@ ...@@ -43,17 +43,18 @@
#include <videolan/vlc.h> #include <videolan/vlc.h>
#ifdef SYS_BSD /* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED,
#include <machine/soundcard.h> /* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, * SNDCTL_DSP_GETOSPACE */
SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED, SNDCTL_DSP_GETOSPACE */ #ifdef HAVE_SOUNDCARD_H
#else # include <soundcard.h>
#include <sys/soundcard.h> /* SNDCTL_DSP_RESET, SNDCTL_DSP_SETFMT, #elif defined( HAVE_SYS_SOUNDCARD_H )
SNDCTL_DSP_STEREO, SNDCTL_DSP_SPEED, SNDCTL_DSP_GETOSPACE */ # include <sys/soundcard.h>
#elif defined( HAVE_MACHINE_SOUNDCARD_H )
# include <machine/soundcard.h>
#endif #endif
#include "audio_output.h" /* aout_thread_t */ #include "audio_output.h" /* aout_thread_t */
#define DSP_DEV_VAR "dsp_dev"
/***************************************************************************** /*****************************************************************************
* aout_sys_t: dsp audio output method descriptor * aout_sys_t: dsp audio output method descriptor
***************************************************************************** *****************************************************************************
...@@ -110,7 +111,7 @@ static int aout_Open( aout_thread_t *p_aout ) ...@@ -110,7 +111,7 @@ static int aout_Open( aout_thread_t *p_aout )
} }
/* Initialize some variables */ /* Initialize some variables */
if( !(p_aout->p_sys->psz_device = config_GetPszVariable( DSP_DEV_VAR )) ) if( !(p_aout->p_sys->psz_device = config_GetPszVariable( "dsp_dev" )) )
{ {
intf_ErrMsg( "aout error: don't know which audio device to open" ); intf_ErrMsg( "aout error: don't know which audio device to open" );
free( p_aout->p_sys ); free( p_aout->p_sys );
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* dsp.c : OSS /dev/dsp module for vlc * dsp.c : OSS /dev/dsp module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2000-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: dsp.c,v 1.13 2002/02/24 20:51:09 gbazin Exp $ * $Id: dsp.c,v 1.14 2002/02/27 18:19:21 sam Exp $
* *
* Authors: Michel Kaempf <maxx@via.ecp.fr> * Authors: Michel Kaempf <maxx@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -38,11 +38,9 @@ void _M( aout_getfunctions )( function_list_t * p_function_list ); ...@@ -38,11 +38,9 @@ void _M( aout_getfunctions )( function_list_t * p_function_list );
/***************************************************************************** /*****************************************************************************
* Build configuration tree. * Build configuration tree.
*****************************************************************************/ *****************************************************************************/
#define DSP_DEV_VAR "dsp_dev"
MODULE_CONFIG_START MODULE_CONFIG_START
ADD_CATEGORY_HINT( "Misc Options", NULL ) ADD_CATEGORY_HINT( "Misc Options", NULL )
ADD_FILE ( DSP_DEV_VAR, "/dev/dsp", NULL,"OSS dsp device",NULL ) ADD_FILE ( "dsp_dev", "/dev/dsp", NULL,"OSS dsp device",NULL )
MODULE_CONFIG_STOP MODULE_CONFIG_STOP
MODULE_INIT_START MODULE_INIT_START
......
...@@ -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-2001 VideoLAN * Copyright (C) 2000-2001 VideoLAN
* $Id: video_output.c,v 1.161 2002/02/24 20:51:10 gbazin Exp $ * $Id: video_output.c,v 1.162 2002/02/27 18:19:21 sam Exp $
* *
* Authors: Vincent Seguin <seguin@via.ecp.fr> * Authors: Vincent Seguin <seguin@via.ecp.fr>
* *
...@@ -125,6 +125,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status, ...@@ -125,6 +125,7 @@ vout_thread_t * vout_CreateThread ( int *pi_status,
{ {
p_vout->p_picture[i_index].i_status = FREE_PICTURE; p_vout->p_picture[i_index].i_status = FREE_PICTURE;
p_vout->p_picture[i_index].i_type = EMPTY_PICTURE; p_vout->p_picture[i_index].i_type = EMPTY_PICTURE;
vlc_mutex_init( &p_vout->p_picture[i_index].lock_deccount );
} }
for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++) for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++)
...@@ -640,6 +641,7 @@ static void EndThread( vout_thread_t *p_vout ) ...@@ -640,6 +641,7 @@ static void EndThread( vout_thread_t *p_vout )
{ {
free( p_vout->p_picture[i_index].p_data ); free( p_vout->p_picture[i_index].p_data );
} }
vlc_mutex_destroy( &p_vout->p_picture[i_index].lock_deccount );
} }
/* Destroy all remaining subpictures */ /* Destroy all remaining subpictures */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_pictures.c : picture management functions * vout_pictures.c : picture management functions
***************************************************************************** *****************************************************************************
* Copyright (C) 2000 VideoLAN * Copyright (C) 2000 VideoLAN
* $Id: vout_pictures.c,v 1.17 2002/02/27 03:47:56 sam Exp $ * $Id: vout_pictures.c,v 1.18 2002/02/27 18:19:21 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>
...@@ -192,9 +192,6 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout, ...@@ -192,9 +192,6 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
vlc_mutex_unlock( &p_vout->picture_lock ); vlc_mutex_unlock( &p_vout->picture_lock );
/* Initialize mutex */
vlc_mutex_init( &(p_freepic->lock_deccount) );
return( p_freepic ); return( p_freepic );
} }
...@@ -230,9 +227,6 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic ) ...@@ -230,9 +227,6 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
p_pic->i_status = DESTROYED_PICTURE; p_pic->i_status = DESTROYED_PICTURE;
p_vout->i_heap_size--; p_vout->i_heap_size--;
/* destroy the lock that had been initialized in CreatePicture */
vlc_mutex_destroy( &(p_pic->lock_deccount) );
vlc_mutex_unlock( &p_vout->picture_lock ); vlc_mutex_unlock( &p_vout->picture_lock );
} }
......
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