Commit 9d3b03de authored by Eric Petit's avatar Eric Petit

+ input/decoder.c: detach decoder after vout_Request(...,0,0,0,0)ing

     so AttachSPU can still reach p_input
 + src/video_output/*: init mouse variable before attaching p_vout so
     dvdnav can't add callbacks on those before there're created
 + beos/VideoOutput.cpp: removed tabs, sanity check
parent 2c6dfafb
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method * vout_beos.cpp: beos video output display method
***************************************************************************** *****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN * Copyright (C) 2000, 2001 VideoLAN
* $Id: VideoOutput.cpp,v 1.29 2003/12/28 01:49:12 titer Exp $ * $Id$
* *
* Authors: Jean-Marc Dressler <polux@via.ecp.fr> * Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org> * Samuel Hocevar <sam@zoy.org>
...@@ -1120,7 +1120,7 @@ VideoWindow::_save_screen_shot( void* cookie ) ...@@ -1120,7 +1120,7 @@ VideoWindow::_save_screen_shot( void* cookie )
*****************************************************************************/ *****************************************************************************/
VLCView::VLCView(BRect bounds, vout_thread_t *p_vout_instance ) VLCView::VLCView(BRect bounds, vout_thread_t *p_vout_instance )
: BView(bounds, "video view", B_FOLLOW_NONE, B_WILL_DRAW | B_PULSE_NEEDED), : BView(bounds, "video view", B_FOLLOW_NONE, B_WILL_DRAW | B_PULSE_NEEDED),
fLastMouseMovedTime(system_time()), fLastMouseMovedTime(mdate()),
fCursorHidden(false), fCursorHidden(false),
fCursorInside(false), fCursorInside(false),
fIgnoreDoubleClick(false) fIgnoreDoubleClick(false)
...@@ -1257,7 +1257,7 @@ VLCView::MouseDown(BPoint where) ...@@ -1257,7 +1257,7 @@ VLCView::MouseDown(BPoint where)
} }
} }
} }
fLastMouseMovedTime = system_time(); fLastMouseMovedTime = mdate();
fCursorHidden = false; fCursorHidden = false;
} }
...@@ -1278,15 +1278,20 @@ VLCView::MouseUp( BPoint where ) ...@@ -1278,15 +1278,20 @@ VLCView::MouseUp( BPoint where )
void void
VLCView::MouseMoved(BPoint point, uint32 transit, const BMessage* dragMessage) VLCView::MouseMoved(BPoint point, uint32 transit, const BMessage* dragMessage)
{ {
fLastMouseMovedTime = system_time(); fLastMouseMovedTime = mdate();
fCursorHidden = false; fCursorHidden = false;
fCursorInside = (transit == B_INSIDE_VIEW || transit == B_ENTERED_VIEW); fCursorInside = ( transit == B_INSIDE_VIEW || transit == B_ENTERED_VIEW );
/* DVD navigation */
if( !fCursorInside )
{
return;
}
vlc_value_t val;
unsigned int i_width, i_height, i_x, i_y; unsigned int i_width, i_height, i_x, i_y;
vout_PlacePicture( p_vout, (unsigned int)Bounds().Width(), vout_PlacePicture( p_vout, (unsigned int)Bounds().Width(),
(unsigned int)Bounds().Height(), (unsigned int)Bounds().Height(),
&i_x, &i_y, &i_width, &i_height ); &i_x, &i_y, &i_width, &i_height );
vlc_value_t val;
val.i_int = ( (int)point.x - i_x ) * p_vout->render.i_width / i_width; val.i_int = ( (int)point.x - i_x ) * p_vout->render.i_width / i_width;
var_Set( p_vout, "mouse-x", val ); var_Set( p_vout, "mouse-x", val );
val.i_int = ( (int)point.y - i_y ) * p_vout->render.i_height / i_height; val.i_int = ( (int)point.y - i_y ) * p_vout->render.i_height / i_height;
...@@ -1308,7 +1313,7 @@ VLCView::Pulse() ...@@ -1308,7 +1313,7 @@ VLCView::Pulse()
if (!fCursorHidden) if (!fCursorHidden)
{ {
if (fCursorInside if (fCursorInside
&& system_time() - fLastMouseMovedTime > MOUSE_IDLE_TIMEOUT) && mdate() - fLastMouseMovedTime > MOUSE_IDLE_TIMEOUT)
{ {
be_app->ObscureCursor(); be_app->ObscureCursor();
fCursorHidden = true; fCursorHidden = true;
...@@ -1322,7 +1327,7 @@ VLCView::Pulse() ...@@ -1322,7 +1327,7 @@ VLCView::Pulse()
// Workaround to disable the screensaver in full screen: // Workaround to disable the screensaver in full screen:
// we simulate an activity every 29 seconds // we simulate an activity every 29 seconds
if( videoWindow && videoWindow->IsFullScreen() && if( videoWindow && videoWindow->IsFullScreen() &&
system_time() - fLastMouseMovedTime > 29000000 ) mdate() - fLastMouseMovedTime > 29000000 )
{ {
BPoint where; BPoint where;
uint32 buttons; uint32 buttons;
......
...@@ -674,8 +674,6 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block ) ...@@ -674,8 +674,6 @@ static int DecoderDecode( decoder_t *p_dec, block_t *p_block )
*/ */
static void DeleteDecoder( decoder_t * p_dec ) static void DeleteDecoder( decoder_t * p_dec )
{ {
vlc_object_detach( p_dec );
msg_Dbg( p_dec, "killing decoder fourcc `%4.4s', %d PES in FIFO", msg_Dbg( p_dec, "killing decoder fourcc `%4.4s', %d PES in FIFO",
(char*)&p_dec->fmt_in.i_codec, (char*)&p_dec->fmt_in.i_codec,
p_dec->p_owner->p_fifo->i_depth ); p_dec->p_owner->p_fifo->i_depth );
...@@ -739,6 +737,8 @@ static void DeleteDecoder( decoder_t * p_dec ) ...@@ -739,6 +737,8 @@ static void DeleteDecoder( decoder_t * p_dec )
vlc_object_destroy( p_dec->p_owner->p_packetizer ); vlc_object_destroy( p_dec->p_owner->p_packetizer );
} }
vlc_object_detach( p_dec );
free( p_dec->p_owner ); free( p_dec->p_owner );
} }
......
...@@ -297,6 +297,13 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent, ...@@ -297,6 +297,13 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
vlc_mutex_init( p_vout, &p_vout->subpicture_lock ); vlc_mutex_init( p_vout, &p_vout->subpicture_lock );
vlc_mutex_init( p_vout, &p_vout->change_lock ); vlc_mutex_init( p_vout, &p_vout->change_lock );
/* Mouse coordinates */
var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
/* Attach the new object now so we can use var inheritance below */ /* Attach the new object now so we can use var inheritance below */
vlc_object_attach( p_vout, p_parent ); vlc_object_attach( p_vout, p_parent );
......
...@@ -223,13 +223,6 @@ void vout_IntfInit( vout_thread_t *p_vout ) ...@@ -223,13 +223,6 @@ void vout_IntfInit( vout_thread_t *p_vout )
} }
var_AddCallback( p_vout, "fullscreen", FullscreenCallback, NULL ); var_AddCallback( p_vout, "fullscreen", FullscreenCallback, NULL );
/* Mouse coordinates */
var_Create( p_vout, "mouse-x", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-y", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-button-down", VLC_VAR_INTEGER );
var_Create( p_vout, "mouse-moved", VLC_VAR_BOOL );
var_Create( p_vout, "mouse-clicked", VLC_VAR_INTEGER );
var_Create( p_vout, "intf-change", VLC_VAR_BOOL ); var_Create( p_vout, "intf-change", VLC_VAR_BOOL );
val.b_bool = VLC_TRUE; val.b_bool = VLC_TRUE;
var_Set( p_vout, "intf-change", val ); var_Set( p_vout, "intf-change", val );
......
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