Commit 4e7e69d0 authored by Vincent Seguin's avatar Vincent Seguin

Correction de quelques erreurs dans l'interface et vout.

Changement du type vlc_thread_func en vlc_thread_func_t dans le d�codeur.
Utilisation de 2 displays au lieu d'un au cas ou la Xlib ne serait pas thread-safe.
Ajout de droits corrects au fichier de log.

Le bug li� � XShm � la fin est 'normal' (li� au serveur X, pas � moi) : il
disparaitra � condition qu'au moins une image soit affich�e.

Le plantage sauvage de la Xlib � la fin du programme est li� � display.c.
parent d87283ed
......@@ -79,7 +79,7 @@ typedef struct vout_thread_s
*******************************************************************************/
vout_thread_t * vout_CreateThread (
#if defined(VIDEO_X11)
Display *p_display, Window root_window,
char *psz_display, Window root_window,
#elif defined(VIDEO_FB)
//??void
#endif
......
......@@ -7,7 +7,7 @@
* Prototypes
*******************************************************************************/
#if defined(VIDEO_X11)
int vout_SysCreate ( p_vout_thread_t p_vout, Display *p_display, Window root_window );
int vout_SysCreate ( p_vout_thread_t p_vout, char *psz_display, Window root_window );
#elif defined(VIDEO_FB)
int vout_SysCreate ( p_vout_thread_t p_vout );
#endif
......
......@@ -127,7 +127,9 @@ p_intf_msg_t intf_MsgCreate( void )
/* Log file initialization - on failure, file pointer will be null,
* and no log will be issued, but this is not considered as an
* error */
p_msg->i_log_file = open( DEBUG_LOG, O_CREAT | O_APPEND | O_SYNC | O_WRONLY );
p_msg->i_log_file = open( DEBUG_LOG,
O_CREAT | O_APPEND | O_SYNC | O_WRONLY,
0777 );
#endif
}
return( p_msg );
......
......@@ -58,7 +58,7 @@ static void RenderPicture ( vout_thread_t *p_vout, picture_t *p_pic );
*******************************************************************************/
vout_thread_t * vout_CreateThread (
#if defined(VIDEO_X11)
Display *p_display, Window root_window,
char *psz_display, Window root_window,
#elif defined(VIDEO_FB)
//??
#endif
......@@ -77,7 +77,7 @@ vout_thread_t * vout_CreateThread (
intf_DbgMsg( "0x%x\n", p_vout );
if( vout_SysCreate( p_vout
#if defined(VIDEO_X11)
, p_display, root_window
, psz_display, root_window
#elif defined(VIDEO_FB)
//??
#endif
......@@ -146,7 +146,7 @@ void vout_DestroyThread( vout_thread_t *p_vout, int *pi_status )
p_vout->b_die = 1;
/* If status is NULL, wait until thread has been destroyed */
if( pi_status )
if( pi_status == NULL )
{
do
{
......
......@@ -11,40 +11,22 @@
* Preamble
*******************************************************************************/
#include "vlc.h"
/*
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <netinet/in.h>
#include <sys/shm.h>
#include <sys/soundcard.h>
#include <sys/uio.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/XShm.h>
#include "config.h"
#include "common.h"
#include "mtime.h"
#include "vlc_thread.h"
#include "xutils.h"
#include "input.h"
#include "input_vlan.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "video_x11.h"
#include "xconsole.h"
#include "interface.h"
#include "video_sys.h"
#include "intf_msg.h"
*/
/*******************************************************************************
* vout_sys_t: video output X11 method descriptor
......@@ -101,17 +83,28 @@ static void X11DestroyShmImage ( vout_thread_t *p_vout, XImage *p_ximage,
*******************************************************************************
* This function allocate and initialize a X11 vout method.
*******************************************************************************/
int vout_SysCreate( vout_thread_t *p_vout, Display *p_display, Window root_window )
int vout_SysCreate( vout_thread_t *p_vout, char *psz_display, Window root_window )
{
p_vout->p_sys = malloc( sizeof( vout_sys_t ) );
if( p_vout->p_sys != NULL )
if( p_vout->p_sys == NULL )
{
p_vout->p_sys->p_display = p_display;
p_vout->p_sys->root_window = root_window;
return( 0 );
return( 1 );
}
/* Since XLib is usually not thread-safe, we can't use the same display
* pointer than the interface or another thread. However, the window
* id is still valid */
p_vout->p_sys->p_display = XOpenDisplay( psz_display );
if( !p_vout->p_sys->p_display ) /* error */
{
intf_ErrMsg("vout error: can't open display %s\n", psz_display );
free( p_vout->p_sys );
return( 1 );
}
p_vout->p_sys->root_window = root_window;
return( 0 );
}
/*******************************************************************************
......@@ -158,6 +151,7 @@ void vout_SysEnd( vout_thread_t *p_vout )
*******************************************************************************/
void vout_SysDestroy( vout_thread_t *p_vout )
{
XCloseDisplay( p_vout->p_sys->p_display );
free( p_vout->p_sys );
}
......
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