diff --git a/Gui/cfg.c b/Gui/cfg.c index 24f2381dbb..1b5914e178 100644 --- a/Gui/cfg.c +++ b/Gui/cfg.c @@ -18,7 +18,6 @@ // --- params int gtkEnableAudioEqualizer = 0; -int gtkEnableVideoEqualizer = 0; char * gtkVODriver = NULL; int gtkVODoubleBuffer = 1; @@ -61,7 +60,6 @@ static m_config_t * gui_conf; static config_t gui_opts[] = { { "enable_audio_equ",>kEnableAudioEqualizer,CONF_TYPE_FLAG,0,0,1,NULL }, - { "enable_video_equ",>kEnableVideoEqualizer,CONF_TYPE_FLAG,0,0,1,NULL }, { "vo_driver",>kVODriver,CONF_TYPE_STRING,0,0,0,NULL }, { "vo_panscan",&vo_panscan,CONF_TYPE_FLOAT,CONF_RANGE,0.0,1.0,NULL }, diff --git a/Gui/cfg.h b/Gui/cfg.h index 3c16214340..9d9aa2d182 100644 --- a/Gui/cfg.h +++ b/Gui/cfg.h @@ -3,7 +3,6 @@ #define __CFG_H extern int gtkEnableAudioEqualizer; -extern int gtkEnableVideoEqualizer; extern char * gtkVODriver; extern int gtkVODoubleBuffer; diff --git a/Gui/interface.c b/Gui/interface.c index 662db96b90..e6eba8e23b 100644 --- a/Gui/interface.c +++ b/Gui/interface.c @@ -87,7 +87,8 @@ void guiInit( void ) gtkAOOSSDevice=strdup( PATH_DEV_DSP ); gtkInit(); - + wsXInit( (void *)mDisplay ); + cfg_read(); appInit( (void*)mDisplay ); @@ -298,6 +299,18 @@ void guiGetEvent( int type,char * arg ) } break; case guiSetValues: +// -- video + if ( arg ) + { + if ( vo_gamma_brightness == 1000 ) + { vo_gamma_brightness=0; get_video_colors( (void *)arg,"brightness",&vo_gamma_brightness ); } + if ( vo_gamma_contrast == 1000 ) + { vo_gamma_contrast=0; get_video_colors( (void *)arg,"contrast",&vo_gamma_contrast ); } + if ( vo_gamma_hue == 1000 ) + { vo_gamma_hue=0; get_video_colors( (void *)arg,"hue",&vo_gamma_hue ); } + if ( vo_gamma_saturation == 1000 ) + { vo_gamma_saturation=0; get_video_colors( (void *)arg,"saturation",&vo_gamma_saturation ); } + } // -- audio if ( audio_out ) { diff --git a/Gui/mplayer/gtk/eq.c b/Gui/mplayer/gtk/eq.c index 3b3d1775e4..b87cb2aba8 100644 --- a/Gui/mplayer/gtk/eq.c +++ b/Gui/mplayer/gtk/eq.c @@ -116,7 +116,7 @@ void ShowEqualizer( void ) VHueadj->value=(float)vo_gamma_hue; VSaturationadj->value=(float)vo_gamma_saturation; - if ( !guiIntfStruct.Playing || !gtkEnableVideoEqualizer ) + if ( !guiIntfStruct.Playing ) { gtk_widget_set_sensitive( VContrast,FALSE ); gtk_widget_set_sensitive( VBrightness,FALSE ); @@ -210,7 +210,7 @@ static void eqButtonReleased( GtkButton * button,gpointer user_data ) } else { - if ( !guiIntfStruct.Playing || !gtkEnableVideoEqualizer ) break; + if ( !guiIntfStruct.Playing ) break; gtkSet( gtkSetContrast,0.0f,NULL ); gtkSet( gtkSetBrightness,0.0f,NULL ); gtkSet( gtkSetHue,0.0f,NULL ); diff --git a/Gui/mplayer/gtk/fs.c b/Gui/mplayer/gtk/fs.c index d57b8f18c0..424e2313dc 100644 --- a/Gui/mplayer/gtk/fs.c +++ b/Gui/mplayer/gtk/fs.c @@ -455,7 +455,7 @@ void fs_Ok_released( GtkButton * button,gpointer user_data ) item=item->next; } if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() ); - if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 ); + if ( mplMainAutoPlay ) { mplMainAutoPlay=0; mplEventHandling( evPlay,0 ); } } void fs_Cancel_released( GtkButton * button,gpointer user_data ) diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c index 63c4f6f698..33549c066d 100644 --- a/Gui/mplayer/gtk/opts.c +++ b/Gui/mplayer/gtk/opts.c @@ -35,7 +35,6 @@ static GtkWidget * EVFM; static GtkWidget * CBVFM; static GtkWidget * CBAudioEqualizer; -static GtkWidget * CBVideoEqualizer; //static GtkWidget * CBSurround; static GtkWidget * CBExtraStereo; static GtkWidget * CBNoSound; @@ -122,7 +121,7 @@ void ShowPreferences( void ) { const ao_info_t *info = audio_out_drivers[i++]->info; if ( !strcmp( info->short_name,"plugin" ) ) continue; - if ( !strcmp( gtkAODriver,info->short_name ) ) old_audio_driver=i - 1; + if ( !gstrcmp( gtkAODriver,info->short_name ) ) old_audio_driver=i - 1; tmp[0]=(char *)info->short_name; tmp[1]=(char *)info->name; gtk_clist_append( GTK_CLIST( CLADrivers ),tmp ); } gtk_clist_select_row( GTK_CLIST( CLADrivers ),old_audio_driver,0 ); @@ -132,7 +131,6 @@ void ShowPreferences( void ) } // -- 2. page - gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBVideoEqualizer ),gtkEnableVideoEqualizer ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ),gtkVODoubleBuffer ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBDR ),gtkVODirectRendering ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBFramedrop ),gtkVFrameDrop ); @@ -282,7 +280,6 @@ void prButton( GtkButton * button,gpointer user_data ) gtkVODriver=gstrdup( vo_driver[0] ); // -- 2. page - gtkEnableVideoEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBVideoEqualizer ) ); gtkVODoubleBuffer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDoubleBuffer ) ); gtkVODirectRendering=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBDR ) ); gtkVFrameDrop=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFramedrop ) ); @@ -822,13 +819,6 @@ GtkWidget * create_Preferences( void ) gtk_container_add( GTK_CONTAINER( frame ),vbox5 ); gtk_widget_set_usize( vbox5,250,-2 ); - CBVideoEqualizer=gtk_check_button_new_with_label( MSGTR_PREFERENCES_VideoEqu ); - gtk_widget_set_name( CBVideoEqualizer,"CBVideoEqualizer" ); - gtk_widget_ref( CBVideoEqualizer ); - gtk_object_set_data_full( GTK_OBJECT( Preferences ),"CBVideoEqualizer",CBVideoEqualizer,(GtkDestroyNotify)gtk_widget_unref ); - gtk_widget_show( CBVideoEqualizer ); - gtk_box_pack_start( GTK_BOX( vbox5 ),CBVideoEqualizer,FALSE,FALSE,0 ); - CBDoubleBuffer=gtk_check_button_new_with_label( MSGTR_PREFERENCES_DoubleBuffer ); gtk_widget_set_name( CBDoubleBuffer,"CBDoubleBuffer" ); gtk_widget_ref( CBDoubleBuffer ); diff --git a/Gui/mplayer/mplayer.c b/Gui/mplayer/mplayer.c index 7b1fdc8155..68c5a18815 100644 --- a/Gui/mplayer/mplayer.c +++ b/Gui/mplayer/mplayer.c @@ -54,10 +54,10 @@ void mplInit( void * disp ) // read gui.conf, gui.pl cfg_read(); -#endif // opens X display, checks for extensions (XShape, DGA etc) wsXInit( disp ); +#endif if ( ( mplDrawBuffer = (unsigned char *)calloc( 1,appMPlayer.main.Bitmap.ImageSize ) ) == NULL ) { diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c index d0b88fc1cf..2c547a44a8 100644 --- a/Gui/mplayer/play.c +++ b/Gui/mplayer/play.c @@ -102,11 +102,14 @@ void mplEnd( void ) } else { - if ( mplMainAutoPlay ) { mplMainAutoPlay=0; return; } + if ( guiIntfStruct.FilenameChanged ) return; guiIntfStruct.TimeSec=0; guiIntfStruct.Position=0; guiIntfStruct.AudioType=0; + guiIntfStruct.DVD.current_title=1; + guiIntfStruct.DVD.current_chapter=1; + guiIntfStruct.DVD.current_angle=1; if ( !appMPlayer.subWindow.isFullScreen ) { diff --git a/mplayer.c b/mplayer.c index 263109e798..57194af7a8 100644 --- a/mplayer.c +++ b/mplayer.c @@ -1358,7 +1358,7 @@ fflush(stdout); guiGetEvent( guiSetFileName,filename ); if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels; else guiIntfStruct.AudioType=0; if ( !sh_video && sh_audio ) guiGetEvent( guiSetAudioOnly,(char *)1 ); else guiGetEvent( guiSetAudioOnly,(char *)0 ); - guiGetEvent( guiSetValues,NULL ); + guiGetEvent( guiSetValues,(char *)sh_video ); } #endif @@ -2920,12 +2920,9 @@ if(rel_seek_secs || abs_seek_pos){ // get pos from frame number / total frames guiIntfStruct.Position=(float)d_video->pack_no*100.0f/sh_video->video.dwLength; } else { - // get pos from file position / filesize - int len=((demuxer->movi_end-demuxer->movi_start)); - int pos; - if ( demuxer->file_format==DEMUXER_TYPE_AUDIO ) pos=stream->pos; - else pos=(demuxer->file_format==DEMUXER_TYPE_AVI)?demuxer->filepos:d_video->pos; - guiIntfStruct.Position=(len<=0)?0:((float)(pos-demuxer->movi_start) / len * 100.0f); + int len = ( ( demuxer->movi_end - demuxer->movi_start ) >> 8 ); + int pos = ( demuxer->file_format == DEMUXER_TYPE_AUDIO?stream->pos:demuxer->filepos ); + guiIntfStruct.Position=(len <= 0? 0.0f : ( pos - demuxer->movi_start ) / len / 2.56f /* / 256.0f * 100.0f */ ); } if ( sh_video ) guiIntfStruct.TimeSec=d_video->pts; else if ( sh_audio ) guiIntfStruct.TimeSec=sh_audio->timer;