[MPlayer-cvslog] r38619 - in trunk/gui: dialog/preferences.c interface.c
ib
subversion at mplayerhq.hu
Mon Jun 24 21:19:47 EEST 2024
Author: ib
Date: Mon Jun 24 21:19:47 2024
New Revision: 38619
Log:
Keep old auto_quality value when canceling the preferences dialog.
Check its current value and reset it if necessary when canceling
the dialog.
Also, do not set it when pressing OK, because prHScaleChanged()
will have already done so if it has been changed.
Moreover, set its initial value when creating the dialog, and check
the value passed to mplayer()'s MPLAYER_SET_AUTO_QUALITY.
Modified:
trunk/gui/dialog/preferences.c
trunk/gui/interface.c
Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c Mon Jun 24 21:17:40 2024 (r38618)
+++ trunk/gui/dialog/preferences.c Mon Jun 24 21:19:47 2024 (r38619)
@@ -228,6 +228,7 @@ static float old_osd_font_scale_factor;
#else
static float old_font_factor;
#endif
+static int old_auto_quality;
static GtkWidget *AudioConfig;
static GtkWidget *DXR3Config;
@@ -419,7 +420,6 @@ static void prButton( GtkButton * button
gui_tv_digital=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBTVDigital ) );
player_idle_mode=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoIdle ) );
allow_playlist_parsing = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBPlaylists));
- mplayer( MPLAYER_SET_AUTO_QUALITY,gtk_adjustment_get_value(HSPPQualityadj),0 );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)gtk_adjustment_get_value(SBCacheadj); gtkCacheOn=True; }
else gtkCacheOn=False;
@@ -453,6 +453,7 @@ static void prButton( GtkButton * button
#else
if (font_factor != old_font_factor) mplayer(MPLAYER_SET_FONT_FACTOR, old_font_factor, 0);
#endif
+ if (auto_quality != old_auto_quality) mplayer(MPLAYER_SET_AUTO_QUALITY, old_auto_quality, 0);
destroy:
gtk_widget_destroy( Preferences );
if ( AudioConfig ) gtk_widget_destroy( AudioConfig );
@@ -1141,7 +1142,8 @@ static GtkWidget * CreatePreferences( vo
gtkAddLabelColon( _(MSGTR_GUI_MaximumUsageSpareCPU),hbox5 );
- HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,0,0,1,0,0 ) );
+ old_auto_quality = auto_quality;
+ HSPPQualityadj=GTK_ADJUSTMENT( gtk_adjustment_new( auto_quality,0,100,1,0,0 ) );
HSPPQuality=gtkAddHScale( HSPPQualityadj,hbox5,0 );
vbox602=gtkAddVBox(
@@ -1286,8 +1288,8 @@ static GtkWidget * CreatePreferences( vo
void ShowPreferences( void )
{
gboolean preferences;
+ gdouble upper;
GSList *list;
- gdouble upper = 0, value = 0;
preferences = (Preferences != NULL);
@@ -1296,11 +1298,11 @@ void ShowPreferences( void )
if (guiInfo.sh_video && guiInfo.Playing)
{
upper = get_video_quality_max(guiInfo.sh_video);
- value = auto_quality;
+ old_auto_quality = auto_quality = FFMIN(auto_quality, upper);
+ gtk_adjustment_set_upper(HSPPQualityadj, upper);
+ gtk_adjustment_set_value(HSPPQualityadj, auto_quality);
+ gtk_adjustment_value_changed(HSPPQualityadj);
}
- gtk_adjustment_set_upper(HSPPQualityadj, upper);
- gtk_adjustment_set_value(HSPPQualityadj, value);
- gtk_adjustment_value_changed(HSPPQualityadj);
if (preferences)
{
Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c Mon Jun 24 21:17:40 2024 (r38618)
+++ trunk/gui/interface.c Mon Jun 24 21:19:47 2024 (r38619)
@@ -1350,6 +1350,8 @@ void mplayer(int what, float value, void
break;
case MPLAYER_SET_AUTO_QUALITY:
+ if (guiInfo.sh_video)
+ value = FFMIN(value, get_video_quality_max(guiInfo.sh_video));
auto_quality = (int)value;
break;
More information about the MPlayer-cvslog
mailing list