From: Tony Castley Date: Thu, 6 Dec 2001 10:29:40 +0000 (+0000) Subject: Added funcionality for vertical retrace sync for refresh rates 60Hz or lower X-Git-Tag: 0.3.0~346 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6d1e0c517b8e80820cf019edbd3b1fcfaf752160;p=vlc Added funcionality for vertical retrace sync for refresh rates 60Hz or lower (Thanks Rudolf) Fixed the Prev Title Bug, now works. --- diff --git a/plugins/beos/InterfaceWindow.cpp b/plugins/beos/InterfaceWindow.cpp index 082848a81f..03ad843a8d 100644 --- a/plugins/beos/InterfaceWindow.cpp +++ b/plugins/beos/InterfaceWindow.cpp @@ -2,7 +2,7 @@ * InterfaceWindow.cpp: beos interface ***************************************************************************** * Copyright (C) 1999, 2000, 2001 VideoLAN - * $Id: InterfaceWindow.cpp,v 1.8 2001/11/30 09:49:48 tcastley Exp $ + * $Id: InterfaceWindow.cpp,v 1.9 2001/12/06 10:29:40 tcastley Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -428,7 +428,7 @@ void InterfaceWindow::MessageReceived( BMessage * p_message ) i_id = p_intf->p_input->stream.p_selected_area->i_id - 1; /* Disallow area 0 since it is used for video_ts.vob */ - if( i_id < 0 ) + if( i_id > 0 ) { p_area = p_intf->p_input->stream.pp_areas[i_id]; input_ChangeArea( p_intf->p_input, (input_area_t*)p_area ); diff --git a/plugins/beos/VideoWindow.h b/plugins/beos/VideoWindow.h index 0568462e10..ebb08be77c 100644 --- a/plugins/beos/VideoWindow.h +++ b/plugins/beos/VideoWindow.h @@ -2,7 +2,7 @@ * VideoWindow.h: BeOS video window class prototype ***************************************************************************** * Copyright (C) 1999, 2000, 2001 VideoLAN - * $Id: VideoWindow.h,v 1.8 2001/12/01 06:38:53 tcastley Exp $ + * $Id: VideoWindow.h,v 1.9 2001/12/06 10:29:40 tcastley Exp $ * * Authors: Jean-Marc Dressler * Tony Castley @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/ -#include - class VLCView : public BView { public: diff --git a/plugins/beos/vout_beos.cpp b/plugins/beos/vout_beos.cpp index 624575e686..226624c9a7 100644 --- a/plugins/beos/vout_beos.cpp +++ b/plugins/beos/vout_beos.cpp @@ -2,7 +2,7 @@ * vout_beos.cpp: beos video output display method ***************************************************************************** * Copyright (C) 2000, 2001 VideoLAN - * $Id: vout_beos.cpp,v 1.33 2001/12/01 06:38:53 tcastley Exp $ + * $Id: vout_beos.cpp,v 1.34 2001/12/06 10:29:40 tcastley Exp $ * * Authors: Jean-Marc Dressler * Samuel Hocevar @@ -108,21 +108,53 @@ BWindow *beos_GetAppWindow(char *name) return window; } -/***************************************************************************** - * DrawingThread : thread that really does the drawing - *****************************************************************************/ -int32 Draw(void *data) -{ - VideoWindow* p_win; - p_win = (VideoWindow *) data; - if ( p_win->voutWindow->LockLooper() ) - { - p_win->view->DrawBitmap( p_win->bitmap[p_win->i_buffer], - p_win->bitmap[p_win->i_buffer]->Bounds(), - p_win->voutWindow->Bounds() ); - p_win->voutWindow->UnlockLooper(); - } - return B_OK; +/**************************************************************************** +* + * DrawingThread : thread that really does the drawing + **************************************************************************** +*/ +int32 Draw(void *data) +{ + //rudolf: sync init: + BScreen *screen; + display_mode disp_mode; + static uint32 refresh, oldrefresh = 0; + + screen = new BScreen(); + screen-> GetMode(&disp_mode); + refresh = + (disp_mode.timing.pixel_clock * 1000)/((disp_mode.timing.h_total)* + (disp_mode.timing.v_total)); + if (!(refresh == oldrefresh)) + { + printf("\nNew refreshrate is %d:Hz\n",refresh); + oldrefresh = refresh; + if (refresh < 61) + { + printf("Enabling retrace sync.\n"); + } + else + { + printf("Disabling retrace sync.\n"); + } + } + + VideoWindow* p_win; + p_win = (VideoWindow *) data; + if ( p_win-> voutWindow-> LockLooper() ) + { + //rudolf: sync: + if (refresh < 61) + { + screen-> WaitForRetrace(22000);//set timeout for < 45 Hz... + } + + p_win-> view-> DrawBitmap( p_win-> bitmap[p_win-> i_buffer], + p_win-> bitmap[p_win-> i_buffer]-> Bounds(), + p_win-> voutWindow-> Bounds() ); + p_win-> voutWindow-> UnlockLooper(); + } + return B_OK; } /*****************************************************************************