* input_dummy.c: dummy input plugin, to manage "vlc:***" special options
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input_dummy.c,v 1.13 2002/01/09 02:01:14 sam Exp $
+ * $Id: input_dummy.c,v 1.14 2002/01/10 04:11:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
* Local prototypes
*****************************************************************************/
static int DummyProbe ( probedata_t * );
+static void DummyInit ( struct input_thread_s * );
static void DummyOpen ( struct input_thread_s * );
static void DummyClose ( struct input_thread_s * );
+static void DummyEnd ( struct input_thread_s * );
+static int DummyRead ( struct input_thread_s *, data_packet_t ** );
+
+/*****************************************************************************
+ * dummy_data_t: private input data
+ *****************************************************************************/
+typedef struct dummy_data_s
+{
+ /* The real command */
+ int i_command;
+
+ /* Used for the pause command */
+ mtime_t expiration;
+
+} dummy_data_t;
+
+#define COMMAND_NOP 0
+#define COMMAND_QUIT 1
+#define COMMAND_LOOP 2
+#define COMMAND_PAUSE 3
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
{
#define input p_function_list->functions.input
p_function_list->pf_probe = DummyProbe;
- input.pf_init = NULL; /* Not needed, open is called first */
+ input.pf_init = DummyInit;
input.pf_open = DummyOpen;
input.pf_close = DummyClose;
- input.pf_end = NULL;
+ input.pf_end = DummyEnd;
input.pf_set_area = NULL;
- input.pf_read = NULL;
+ input.pf_read = DummyRead;
input.pf_demux = NULL;
input.pf_new_packet = NULL;
input.pf_new_pes = NULL;
#undef input
}
-/*
- * Data reading functions
- */
-
/*****************************************************************************
* DummyProbe: verifies that the input is a vlc command
*****************************************************************************/
}
/*****************************************************************************
- * DummyOpen: open the target, ie. do what the command says
+ * DummyOpen: open the target, ie. do nothing
*****************************************************************************/
static void DummyOpen( input_thread_t * p_input )
{
+ p_input->stream.i_method = INPUT_METHOD_NONE;
+}
+
+/*****************************************************************************
+ * DummyClose: close the target, ie. do nothing
+ *****************************************************************************/
+static void DummyClose( input_thread_t * p_input )
+{
+ ;
+}
+
+/*****************************************************************************
+ * DummyOpen: initialize the target, ie. parse the command
+ *****************************************************************************/
+static void DummyInit( struct input_thread_s *p_input )
+{
+ dummy_data_t* p_method;
char *psz_name = p_input->p_source;
int i_len = strlen( psz_name );
int i_arg;
- /* XXX: Tell the input layer to quit immediately, there must
- * be a nicer way to do this. */
- p_input->b_error = 1;
+ p_input->stream.b_seekable = 0;
if( ( i_len <= 4 ) || strncasecmp( psz_name, "vlc:", 4 ) )
{
/* If the command doesn't start with "vlc:" then it's not for us */
+ p_input->b_error = 1;
return;
}
psz_name += 4;
i_len -= 4;
+ p_method = malloc( sizeof( dummy_data_t ) );
+ if( p_method == NULL )
+ {
+ intf_ErrMsg( "input: out of memory" );
+ p_input->b_error = 1;
+ return;
+ }
+
+ p_input->p_plugin_data = (void *)p_method;
+ p_input->stream.p_demux_data = NULL;
+
/* Check for a "vlc:nop" command */
if( i_len == 3 && !strncasecmp( psz_name, "nop", 3 ) )
{
intf_WarnMsg( 2, "input: command `nop'" );
+ p_method->i_command = COMMAND_NOP;
return;
}
if( i_len == 4 && !strncasecmp( psz_name, "quit", 4 ) )
{
intf_WarnMsg( 2, "input: command `quit'" );
- p_main->p_intf->b_die = 1;
+ p_method->i_command = COMMAND_QUIT;
return;
}
if( i_len == 4 && !strncasecmp( psz_name, "loop", 4 ) )
{
intf_WarnMsg( 2, "input: command `loop'" );
- intf_PlaylistJumpto( p_main->p_playlist, -1 );
+ p_method->i_command = COMMAND_LOOP;
return;
}
if( i_len > 6 && !strncasecmp( psz_name, "pause:", 6 ) )
{
i_arg = atoi( psz_name + 6 );
-
- intf_WarnMsgImm( 2, "input: command `pause %i'", i_arg );
-
- msleep( i_arg * 1000000 );
+ intf_WarnMsg( 2, "input: command `pause %i'", i_arg );
+ p_method->i_command = COMMAND_PAUSE;
+ p_method->expiration = mdate() + (mtime_t)i_arg * (mtime_t)1000000;
return;
}
intf_ErrMsg( "input error: unknown command `%s'", psz_name );
+ free( p_input->p_plugin_data );
+ p_input->b_error = 1;
+
+ return;
}
/*****************************************************************************
- * DummyClose: close the target, ie. do nothing
+ * DummyEnd: end the target, ie. do nothing
*****************************************************************************/
-static void DummyClose( input_thread_t * p_input )
+static void DummyEnd( struct input_thread_s *p_input )
{
- return;
+ free( p_input->p_plugin_data );
+}
+
+/*****************************************************************************
+ * DummyRead: do what the command says
+ *****************************************************************************/
+static int DummyRead( struct input_thread_s *p_input, data_packet_t **pp_data )
+{
+ dummy_data_t* p_method = (dummy_data_t *)p_input->p_plugin_data;
+
+ switch( p_method->i_command )
+ {
+ case COMMAND_QUIT:
+ p_input->b_die = 1;
+ break;
+
+ case COMMAND_LOOP:
+ intf_PlaylistJumpto( p_main->p_playlist, -1 );
+ p_input->b_eof = 1;
+ break;
+
+ case COMMAND_PAUSE:
+ if( mdate() < p_method->expiration )
+ {
+ msleep( 10000 );
+ }
+ else
+ {
+ p_input->b_eof = 1;
+ }
+ break;
+
+ case COMMAND_NOP:
+ default:
+ p_input->b_eof = 1;
+ break;
+ }
+
+ *pp_data = NULL;
+
+ return 0;
}
* -dvd_udf to find files
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_dvd.c,v 1.117 2001/12/31 01:13:12 massiot Exp $
+ * $Id: input_dvd.c,v 1.118 2002/01/10 04:11:25 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
+ p_input->stream.i_method = INPUT_METHOD_DVD;
+
/* If we are here we can control the pace... */
p_input->stream.b_pace_control = 1;
* It depends on: libdvdread for ifo files and block reading.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
- * $Id: input_dvdread.c,v 1.17 2002/01/08 23:34:06 stef Exp $
+ * $Id: input_dvdread.c,v 1.18 2002/01/10 04:11:25 sam Exp $
*
* Author: Stéphane Borel <stef@via.ecp.fr>
*
vlc_mutex_lock( &p_input->stream.stream_lock );
+ p_input->stream.i_method = INPUT_METHOD_DVD;
+
/* If we are here we can control the pace... */
p_input->stream.b_pace_control = 1;
* gtk_display.c: Gtk+ tools for main interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_display.c,v 1.12 2002/01/09 02:01:14 sam Exp $
+ * $Id: gtk_display.c,v 1.13 2002/01/10 04:11:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
break;
default:
- intf_ErrMsg( "intf error: can't determine input method" );
+ intf_WarnMsg( 3, "intf: can't determine input method" );
+ gtk_widget_show( GTK_WIDGET( p_file_box ) );
+ p_label = gtk_object_get_data( GTK_OBJECT(
+ p_intf->p_sys->p_window ),
+ "label_status" );
+ gtk_label_set_text( GTK_LABEL( p_label ),
+ p_input_bank->pp_input[0]->p_source );
break;
}
* xmga.c : X11 MGA plugin for vlc
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xmga.c,v 1.1 2002/01/09 02:01:14 sam Exp $
+ * $Id: xmga.c,v 1.2 2002/01/10 04:11:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
*****************************************************************************/
static void ToggleFullScreen ( vout_thread_t *p_vout )
{
- Atom prop;
- mwmhints_t mwmhints;
- int i_xpos, i_ypos, i_width, i_height;
-
- p_vout->b_fullscreen = !p_vout->b_fullscreen;
-
- if( p_vout->b_fullscreen )
- {
- Window next_parent, parent, *p_dummy, dummy1;
- unsigned int dummy2, dummy3;
-
- intf_WarnMsg( 3, "vout: entering fullscreen mode" );
-
- /* Save current window coordinates so they can be restored when
- * we exit from fullscreen mode */
-
- /* find the real parent, which means the which is a direct child of
- * the root window */
- next_parent = parent = p_vout->p_sys->window;
- while( next_parent != DefaultRootWindow( p_vout->p_sys->p_display ) )
- {
- parent = next_parent;
- XQueryTree( p_vout->p_sys->p_display,
- parent,
+ Atom prop;
+ mwmhints_t mwmhints;
+ int i_xpos, i_ypos, i_width, i_height;
+
+ p_vout->b_fullscreen = !p_vout->b_fullscreen;
+
+ if( p_vout->b_fullscreen )
+ {
+ Window next_parent, parent, *p_dummy, dummy1;
+ unsigned int dummy2, dummy3;
+
+ intf_WarnMsg( 3, "vout: entering fullscreen mode" );
+
+ /* Save current window coordinates so they can be restored when
+ * we exit from fullscreen mode */
+
+ /* find the real parent, which means the which is a direct child of
+ * the root window */
+ next_parent = parent = p_vout->p_sys->window;
+ while( next_parent != DefaultRootWindow( p_vout->p_sys->p_display ) )
+ {
+ parent = next_parent;
+ XQueryTree( p_vout->p_sys->p_display,
+ parent,
+ &dummy1,
+ &next_parent,
+ &p_dummy,
+ &dummy2 );
+ XFree((void *)p_dummy);
+ }
+
+ XGetGeometry( p_vout->p_sys->p_display,
+ p_vout->p_sys->window,
&dummy1,
- &next_parent,
- &p_dummy,
- &dummy2 );
- XFree((void *)p_dummy);
- }
-
- XGetGeometry( p_vout->p_sys->p_display,
- p_vout->p_sys->window,
- &dummy1,
- &dummy2,
- &dummy3,
- &p_vout->p_sys->i_width_backup,
- &p_vout->p_sys->i_height_backup,
- &dummy2, &dummy3 );
-
- XTranslateCoordinates( p_vout->p_sys->p_display,
- parent,
- DefaultRootWindow( p_vout->p_sys->p_display ),
- 0,
- 0,
- &p_vout->p_sys->i_xpos_backup,
- &p_vout->p_sys->i_ypos_backup,
- &dummy1 );
-
- mwmhints.flags = MWM_HINTS_DECORATIONS;
- mwmhints.decorations = 0;
-
- i_xpos = 0;
- i_ypos = 0;
- i_width = DisplayWidth( p_vout->p_sys->p_display,
- p_vout->p_sys->i_screen );
- i_height = DisplayHeight( p_vout->p_sys->p_display,
+ &dummy2,
+ &dummy3,
+ &p_vout->p_sys->i_width_backup,
+ &p_vout->p_sys->i_height_backup,
+ &dummy2, &dummy3 );
+
+ XTranslateCoordinates( p_vout->p_sys->p_display,
+ parent,
+ DefaultRootWindow( p_vout->p_sys->p_display ),
+ 0,
+ 0,
+ &p_vout->p_sys->i_xpos_backup,
+ &p_vout->p_sys->i_ypos_backup,
+ &dummy1 );
+
+ mwmhints.flags = MWM_HINTS_DECORATIONS;
+ mwmhints.decorations = 0;
+
+ i_xpos = 0;
+ i_ypos = 0;
+ i_width = DisplayWidth( p_vout->p_sys->p_display,
p_vout->p_sys->i_screen );
+ i_height = DisplayHeight( p_vout->p_sys->p_display,
+ p_vout->p_sys->i_screen );
#if 0
- /* Being a transient window allows us to really be fullscreen (display
- * over the taskbar for instance) but then we end-up with the same
- * result as with the brute force method */
- XSetTransientForHint( p_vout->p_sys->p_display,
- p_vout->p_sys->window, None );
+ /* Being a transient window allows us to really be fullscreen (display
+ * over the taskbar for instance) but then we end-up with the same
+ * result as with the brute force method */
+ XSetTransientForHint( p_vout->p_sys->p_display,
+ p_vout->p_sys->window, None );
#endif
- }
- else
- {
- intf_WarnMsg( 3, "vout: leaving fullscreen mode" );
-
- mwmhints.flags = MWM_HINTS_DECORATIONS;
- mwmhints.decorations = 1;
-
- i_xpos = p_vout->p_sys->i_xpos_backup;
- i_ypos = p_vout->p_sys->i_ypos_backup;
- i_width = p_vout->p_sys->i_width_backup;
- i_height = p_vout->p_sys->i_height_backup;
- }
-
- /* To my knowledge there are two ways to create a borderless window.
- * There's the generic way which is to tell x to bypass the window manager,
- * but this creates problems with the focus of other applications.
- * The other way is to use the motif property "_MOTIF_WM_HINTS" which
- * luckily seems to be supported by most window managers.
- */
- prop = XInternAtom( p_vout->p_sys->p_display, "_MOTIF_WM_HINTS",
- False );
- XChangeProperty( p_vout->p_sys->p_display, p_vout->p_sys->window,
- prop, prop, 32, PropModeReplace,
- (unsigned char *)&mwmhints,
- PROP_MWM_HINTS_ELEMENTS );
+ }
+ else
+ {
+ intf_WarnMsg( 3, "vout: leaving fullscreen mode" );
+
+ mwmhints.flags = MWM_HINTS_DECORATIONS;
+ mwmhints.decorations = 1;
+
+ i_xpos = p_vout->p_sys->i_xpos_backup;
+ i_ypos = p_vout->p_sys->i_ypos_backup;
+ i_width = p_vout->p_sys->i_width_backup;
+ i_height = p_vout->p_sys->i_height_backup;
+ }
+
+ /* To my knowledge there are two ways to create a borderless window.
+ * There's the generic way which is to tell x to bypass the window manager,
+ * but this creates problems with the focus of other applications.
+ * The other way is to use the motif property "_MOTIF_WM_HINTS" which
+ * luckily seems to be supported by most window managers.
+ */
+ prop = XInternAtom( p_vout->p_sys->p_display, "_MOTIF_WM_HINTS",
+ False );
+ XChangeProperty( p_vout->p_sys->p_display, p_vout->p_sys->window,
+ prop, prop, 32, PropModeReplace,
+ (unsigned char *)&mwmhints,
+ PROP_MWM_HINTS_ELEMENTS );
#if 0 /* brute force way to remove decorations */
- XSetWindowAttributes attributes;
- attributes.override_redirect = True;
- XChangeWindowAttributes( p_vout->p_sys->p_display,
- p_vout->p_sys->window,
- CWOverrideRedirect,
- &attributes);
+ XSetWindowAttributes attributes;
+ attributes.override_redirect = True;
+ XChangeWindowAttributes( p_vout->p_sys->p_display,
+ p_vout->p_sys->window,
+ CWOverrideRedirect,
+ &attributes);
#endif
- /* We need to unmap and remap the window if we want the window
- * manager to take our changes into effect */
- XUnmapWindow( p_vout->p_sys->p_display, p_vout->p_sys->window);
- XMapRaised( p_vout->p_sys->p_display, p_vout->p_sys->window);
- XMoveResizeWindow( p_vout->p_sys->p_display,
- p_vout->p_sys->window,
- i_xpos,
- i_ypos,
- i_width,
- i_height );
- XFlush( p_vout->p_sys->p_display );
+ /* We need to unmap and remap the window if we want the window
+ * manager to take our changes into effect */
+ XUnmapWindow( p_vout->p_sys->p_display, p_vout->p_sys->window);
+ XMapRaised( p_vout->p_sys->p_display, p_vout->p_sys->window);
+ XMoveResizeWindow( p_vout->p_sys->p_display,
+ p_vout->p_sys->window,
+ i_xpos,
+ i_ypos,
+ i_width,
+ i_height );
+ XSync( p_vout->p_sys->p_display, False );
}
/*****************************************************************************
* mpeg_adec.c: MPEG audio decoder thread
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: mpeg_adec.c,v 1.11 2002/01/09 00:33:37 asmax Exp $
+ * $Id: mpeg_adec.c,v 1.12 2002/01/10 04:11:25 sam Exp $
*
* Authors: Michel Kaempf <maxx@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
{
intf_ErrMsg( "adec error: failed to create Audio Output "
"Fifo." );
- DecoderError( p_adec->p_fifo );
+ p_adec->p_fifo->b_error = 1;
+ return;
}
}
* xcommon.c: Functions common to the X11 and XVideo plugins
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: xcommon.c,v 1.9 2002/01/07 02:12:29 sam Exp $
+ * $Id: xcommon.c,v 1.10 2002/01/10 04:11:25 sam Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
#endif
}
- /* Make sure the command is sent now */
- XFlush( p_vout->p_sys->p_display );
+ /* Make sure the command is sent now - do NOT use XFlush !*/
+ XSync( p_vout->p_sys->p_display, False );
}
/*****************************************************************************
ToggleCursor( p_vout );
}
+ /* Do NOT use XFlush here ! */
XSync( p_vout->p_sys->p_display, False );
/* At this stage, the window is open, displayed, and ready to
*****************************************************************************/
static void DestroyWindow( vout_thread_t *p_vout )
{
+ /* Do NOT use XFlush here ! */
XSync( p_vout->p_sys->p_display, False );
#ifdef MODULE_NAME_IS_xvideo
IMAGE_FREE( p_pic->p_sys->p_image );
}
+ /* Do NOT use XFlush here ! */
XSync( p_vout->p_sys->p_display, False );
free( p_pic->p_sys );
*****************************************************************************/
static void ToggleFullScreen ( vout_thread_t *p_vout )
{
- Atom prop;
- mwmhints_t mwmhints;
- int i_xpos, i_ypos, i_width, i_height;
+ Atom prop;
+ mwmhints_t mwmhints;
+ int i_xpos, i_ypos, i_width, i_height;
- p_vout->b_fullscreen = !p_vout->b_fullscreen;
+ p_vout->b_fullscreen = !p_vout->b_fullscreen;
- if( p_vout->b_fullscreen )
- {
- Window next_parent, parent, *p_dummy, dummy1;
- unsigned int dummy2, dummy3;
+ if( p_vout->b_fullscreen )
+ {
+ Window next_parent, parent, *p_dummy, dummy1;
+ unsigned int dummy2, dummy3;
- intf_WarnMsg( 3, "vout: entering fullscreen mode" );
-
- /* Save current window coordinates so they can be restored when
- * we exit from fullscreen mode */
-
- /* find the real parent, which means the which is a direct child of
- * the root window */
- next_parent = parent = p_vout->p_sys->window;
- while( next_parent != DefaultRootWindow( p_vout->p_sys->p_display ) )
- {
- parent = next_parent;
- XQueryTree( p_vout->p_sys->p_display,
- parent,
+ intf_WarnMsg( 3, "vout: entering fullscreen mode" );
+
+ /* Save current window coordinates so they can be restored when
+ * we exit from fullscreen mode */
+
+ /* find the real parent, which means the which is a direct child of
+ * the root window */
+ next_parent = parent = p_vout->p_sys->window;
+ while( next_parent != DefaultRootWindow( p_vout->p_sys->p_display ) )
+ {
+ parent = next_parent;
+ XQueryTree( p_vout->p_sys->p_display,
+ parent,
+ &dummy1,
+ &next_parent,
+ &p_dummy,
+ &dummy2 );
+ XFree((void *)p_dummy);
+ }
+
+ XGetGeometry( p_vout->p_sys->p_display,
+ p_vout->p_sys->window,
&dummy1,
- &next_parent,
- &p_dummy,
- &dummy2 );
- XFree((void *)p_dummy);
- }
-
- XGetGeometry( p_vout->p_sys->p_display,
- p_vout->p_sys->window,
- &dummy1,
- &dummy2,
- &dummy3,
- &p_vout->p_sys->i_width_backup,
- &p_vout->p_sys->i_height_backup,
- &dummy2, &dummy3 );
-
- XTranslateCoordinates( p_vout->p_sys->p_display,
- parent,
- DefaultRootWindow( p_vout->p_sys->p_display ),
- 0,
- 0,
- &p_vout->p_sys->i_xpos_backup,
- &p_vout->p_sys->i_ypos_backup,
- &dummy1 );
-
- mwmhints.flags = MWM_HINTS_DECORATIONS;
- mwmhints.decorations = 0;
-
- i_xpos = 0;
- i_ypos = 0;
- i_width = DisplayWidth( p_vout->p_sys->p_display,
- p_vout->p_sys->i_screen );
- i_height = DisplayHeight( p_vout->p_sys->p_display,
+ &dummy2,
+ &dummy3,
+ &p_vout->p_sys->i_width_backup,
+ &p_vout->p_sys->i_height_backup,
+ &dummy2, &dummy3 );
+
+ XTranslateCoordinates( p_vout->p_sys->p_display,
+ parent,
+ DefaultRootWindow( p_vout->p_sys->p_display ),
+ 0,
+ 0,
+ &p_vout->p_sys->i_xpos_backup,
+ &p_vout->p_sys->i_ypos_backup,
+ &dummy1 );
+
+ mwmhints.flags = MWM_HINTS_DECORATIONS;
+ mwmhints.decorations = 0;
+
+ i_xpos = 0;
+ i_ypos = 0;
+ i_width = DisplayWidth( p_vout->p_sys->p_display,
p_vout->p_sys->i_screen );
+ i_height = DisplayHeight( p_vout->p_sys->p_display,
+ p_vout->p_sys->i_screen );
#if 0
- /* Being a transient window allows us to really be fullscreen (display
- * over the taskbar for instance) but then we end-up with the same
- * result as with the brute force method */
- XSetTransientForHint( p_vout->p_sys->p_display,
- p_vout->p_sys->window, None );
+ /* Being a transient window allows us to really be fullscreen (display
+ * over the taskbar for instance) but then we end-up with the same
+ * result as with the brute force method */
+ XSetTransientForHint( p_vout->p_sys->p_display,
+ p_vout->p_sys->window, None );
#endif
- }
- else
- {
- intf_WarnMsg( 3, "vout: leaving fullscreen mode" );
+ }
+ else
+ {
+ intf_WarnMsg( 3, "vout: leaving fullscreen mode" );
- mwmhints.flags = MWM_HINTS_DECORATIONS;
- mwmhints.decorations = 1;
-
- i_xpos = p_vout->p_sys->i_xpos_backup;
- i_ypos = p_vout->p_sys->i_ypos_backup;
- i_width = p_vout->p_sys->i_width_backup;
- i_height = p_vout->p_sys->i_height_backup;
- }
-
- /* To my knowledge there are two ways to create a borderless window.
- * There's the generic way which is to tell x to bypass the window manager,
- * but this creates problems with the focus of other applications.
- * The other way is to use the motif property "_MOTIF_WM_HINTS" which
- * luckily seems to be supported by most window managers.
- */
- prop = XInternAtom( p_vout->p_sys->p_display, "_MOTIF_WM_HINTS",
- False );
- XChangeProperty( p_vout->p_sys->p_display, p_vout->p_sys->window,
- prop, prop, 32, PropModeReplace,
- (unsigned char *)&mwmhints,
- PROP_MWM_HINTS_ELEMENTS );
+ mwmhints.flags = MWM_HINTS_DECORATIONS;
+ mwmhints.decorations = 1;
+
+ i_xpos = p_vout->p_sys->i_xpos_backup;
+ i_ypos = p_vout->p_sys->i_ypos_backup;
+ i_width = p_vout->p_sys->i_width_backup;
+ i_height = p_vout->p_sys->i_height_backup;
+ }
+
+ /* To my knowledge there are two ways to create a borderless window.
+ * There's the generic way which is to tell x to bypass the window manager,
+ * but this creates problems with the focus of other applications.
+ * The other way is to use the motif property "_MOTIF_WM_HINTS" which
+ * luckily seems to be supported by most window managers.
+ */
+ prop = XInternAtom( p_vout->p_sys->p_display, "_MOTIF_WM_HINTS",
+ False );
+ XChangeProperty( p_vout->p_sys->p_display, p_vout->p_sys->window,
+ prop, prop, 32, PropModeReplace,
+ (unsigned char *)&mwmhints,
+ PROP_MWM_HINTS_ELEMENTS );
#if 0 /* brute force way to remove decorations */
- XSetWindowAttributes attributes;
- attributes.override_redirect = True;
- XChangeWindowAttributes( p_vout->p_sys->p_display,
- p_vout->p_sys->window,
- CWOverrideRedirect,
- &attributes);
+ XSetWindowAttributes attributes;
+ attributes.override_redirect = True;
+ XChangeWindowAttributes( p_vout->p_sys->p_display,
+ p_vout->p_sys->window,
+ CWOverrideRedirect,
+ &attributes);
#endif
- /* We need to unmap and remap the window if we want the window
- * manager to take our changes into effect */
- XUnmapWindow( p_vout->p_sys->p_display, p_vout->p_sys->window);
- XMapRaised( p_vout->p_sys->p_display, p_vout->p_sys->window);
- XMoveResizeWindow( p_vout->p_sys->p_display,
- p_vout->p_sys->window,
- i_xpos,
- i_ypos,
- i_width,
- i_height );
- XFlush( p_vout->p_sys->p_display );
+ /* We need to unmap and remap the window if we want the window
+ * manager to take our changes into effect */
+ XUnmapWindow( p_vout->p_sys->p_display, p_vout->p_sys->window);
+ XMapRaised( p_vout->p_sys->p_display, p_vout->p_sys->window);
+ XMoveResizeWindow( p_vout->p_sys->p_display,
+ p_vout->p_sys->window,
+ i_xpos,
+ i_ypos,
+ i_width,
+ i_height );
+
+ /* Do NOT use XFlush here ! */
+ XSync( p_vout->p_sys->p_display, False );
}
/*****************************************************************************
}
/* Send image to X server. This instruction is required, since having
- * built a Shm XImage and not using it causes an error on XCloseDisplay */
+ * built a Shm XImage and not using it causes an error on XCloseDisplay,
+ * and remember NOT to use XFlush ! */
XSync( p_display, False );
#if 0
* decoders.
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input.c,v 1.169 2002/01/09 02:01:14 sam Exp $
+ * $Id: input.c,v 1.170 2002/01/10 04:11:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
p_input->stream.b_new_mute = MUTE_NO_CHANGE;
p_input->stream.i_mux_rate = 0;
- /* no stream, no area */
+ /* no stream, no program, no area, no es */
+ p_input->stream.p_new_program = NULL;
+
p_input->stream.i_area_nb = 0;
p_input->stream.pp_areas = NULL;
p_input->stream.p_selected_area = NULL;
p_input->stream.p_new_area = NULL;
+ p_input->stream.pp_selected_es = NULL;
+ p_input->stream.p_removed_es = NULL;
+ p_input->stream.p_newly_selected_es = NULL;
+
/* By default there is one area in a stream */
input_AddArea( p_input );
p_input->stream.p_selected_area = p_input->stream.pp_areas[0];
if( f.pf_open != NULL )
{
f.pf_open( p_input );
- p_input->stream.i_method = INPUT_METHOD_DVD;
}
#if !defined( SYS_BEOS ) && !defined( SYS_NTO )
/* FIXME : this is waaaay too kludgy */
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998-2001 VideoLAN
- * $Id: input_ext-intf.c,v 1.32 2001/12/30 07:09:56 sam Exp $
+ * $Id: input_ext-intf.c,v 1.33 2002/01/10 04:11:25 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
case INPUT_STATUS_END:
p_input->stream.i_new_status = PLAYING_S;
p_input->b_eof = 1;
- intf_Msg( "input: end of stream" );
+ intf_WarnMsg( 1, "input: end of stream" );
break;
case INPUT_STATUS_PLAY:
p_input->stream.i_new_status = PLAYING_S;
- intf_Msg( "input: playing at normal rate" );
+ intf_WarnMsg( 1, "input: playing at normal rate" );
break;
case INPUT_STATUS_PAUSE:
/* XXX: we don't need to check i_status, because input_clock.c
* does it for us */
p_input->stream.i_new_status = PAUSE_S;
- intf_Msg( "input: toggling pause" );
+ intf_WarnMsg( 1, "input: toggling pause" );
break;
case INPUT_STATUS_FASTER:
if( p_input->stream.control.i_rate * 8 <= DEFAULT_RATE )
{
p_input->stream.i_new_status = PLAYING_S;
- intf_Msg( "input: playing at normal rate" );
+ intf_WarnMsg( 1, "input: playing at normal rate" );
}
else
{
{
p_input->stream.i_new_rate = DEFAULT_RATE / 2;
}
- intf_Msg( "input: playing at %i:1 fast forward",
- DEFAULT_RATE / p_input->stream.i_new_rate );
+ intf_WarnMsg( 1, "input: playing at %i:1 fast forward",
+ DEFAULT_RATE / p_input->stream.i_new_rate );
}
break;
if( p_input->stream.control.i_rate >= 8 * DEFAULT_RATE )
{
p_input->stream.i_new_status = PLAYING_S;
- intf_Msg( "input: playing at normal rate" );
+ intf_WarnMsg( 1, "input: playing at normal rate" );
}
else
{
{
p_input->stream.i_new_rate = DEFAULT_RATE * 2;
}
- intf_Msg( "input: playing at 1:%i slow motion",
- p_input->stream.i_new_rate / DEFAULT_RATE );
+ intf_WarnMsg( 1, "input: playing at 1:%i slow motion",
+ p_input->stream.i_new_rate / DEFAULT_RATE );
}
break;
* intf_playlist.c : Playlist management functions
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
- * $Id: intf_playlist.c,v 1.12 2001/12/30 07:09:56 sam Exp $
+ * $Id: intf_playlist.c,v 1.13 2002/01/10 04:11:25 sam Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
{
vlc_mutex_lock( &p_playlist->change_lock );
- p_playlist->i_index = i_pos;
+ if( i_pos < -1 )
+ {
+ i_pos = -1;
+ }
- if( p_playlist->i_index != -1 )
+ if( i_pos != -1 )
{
if( p_playlist->current.psz_name != NULL )
{
free( p_playlist->current.psz_name );
}
- p_playlist->current = p_playlist->p_item[ p_playlist->i_index ];
- p_playlist->current.psz_name
- = strdup( p_playlist->current.psz_name );
-
+ p_playlist->current = p_playlist->p_item[ i_pos ];
+ p_playlist->current.psz_name = strdup( p_playlist->current.psz_name );
}
- p_main->p_playlist->b_stopped = 0;
+
+ p_playlist->i_index = i_pos;
+ p_playlist->b_stopped = 0;
vlc_mutex_unlock( &p_playlist->change_lock );
}