summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrifa75 <yahiaoui.fakhri@gmail.com>2022-11-17 02:25:01 +0100
committerBastien Nocera <hadess@hadess.net>2022-11-17 10:15:17 +0100
commiteee7d9f7c3fa19409857ea6a8a4ba48c45d1d4cb (patch)
tree3487d05098a5a69f941cf84484c82e8e6c3d45b6
parent56906a95ccc8811901fa304ad87d320aab7d93ac (diff)
downloadtotem-eee7d9f7c3fa19409857ea6a8a4ba48c45d1d4cb.tar.gz
preferences: Allow to disable hardware acceleration
Closes: #501
-rw-r--r--data/totem-preferences-dialog.ui20
-rw-r--r--src/totem-preferences-dialog.c6
2 files changed, 26 insertions, 0 deletions
diff --git a/data/totem-preferences-dialog.ui b/data/totem-preferences-dialog.ui
index da525c0e7..775093478 100644
--- a/data/totem-preferences-dialog.ui
+++ b/data/totem-preferences-dialog.ui
@@ -213,6 +213,26 @@ Disable deinterlacing if you encounter graphical artifacts such as combing.</pro
</object>
</child>
+ <child>
+ <object class="HdyActionRow">
+ <property name="visible">True</property>
+ <property name="use_underline">True</property>
+ <property name="title" translatable="yes">Disable hardware acceleration</property>
+ <property name="subtitle" translatable="yes">Hardware acceleration is used automatically when available.
+Disable it if you encounter video playback problems.</property>
+ <property name="activatable-widget">tpw_no_hardware_acceleration</property>
+
+ <child>
+ <object class="GtkSwitch" id="tpw_no_hardware_acceleration">
+ <property name="visible">True</property>
+ <property name="valign">center</property>
+ <property name="focus_on_click">False</property>
+ </object>
+ </child>
+
+ </object>
+ </child>
+
</object>
</child>
diff --git a/src/totem-preferences-dialog.c b/src/totem-preferences-dialog.c
index 08d43bcfb..d21b0e09f 100644
--- a/src/totem-preferences-dialog.c
+++ b/src/totem-preferences-dialog.c
@@ -62,6 +62,7 @@ struct _TotemPreferencesDialog {
GtkCheckButton *tpw_auto_subtitles_checkbutton;
GtkWidget *tpw_bright_contr_vbox;
GtkCheckButton *tpw_no_deinterlace_checkbutton;
+ GtkCheckButton *tpw_no_hardware_acceleration;
GtkButton *tpw_plugins_button;
GtkComboBox *tpw_sound_output_combobox;
GtkComboBox *subtitle_encoding_combo;
@@ -287,6 +288,10 @@ totem_preferences_dialog_constructed (GObject *object)
g_settings_bind (totem->settings, "disable-deinterlacing", bvw, "deinterlacing",
G_SETTINGS_BIND_DEFAULT | G_SETTINGS_BIND_NO_SENSITIVITY | G_SETTINGS_BIND_INVERT_BOOLEAN);
+ /* Disable hardware acceleration */
+ g_settings_bind (totem->settings, "force-software-decoders",
+ prefs->tpw_no_hardware_acceleration, "active", G_SETTINGS_BIND_DEFAULT);
+
/* Auto-load subtitles */
g_settings_bind (totem->settings, "autoload-subtitles",
prefs->tpw_auto_subtitles_checkbutton, "active", G_SETTINGS_BIND_DEFAULT);
@@ -396,6 +401,7 @@ totem_preferences_dialog_class_init (TotemPreferencesDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, TotemPreferencesDialog, tpw_hue_adjustment);
gtk_widget_class_bind_template_child (widget_class, TotemPreferencesDialog, tpw_hue_scale);
gtk_widget_class_bind_template_child (widget_class, TotemPreferencesDialog, tpw_no_deinterlace_checkbutton);
+ gtk_widget_class_bind_template_child (widget_class, TotemPreferencesDialog, tpw_no_hardware_acceleration);
gtk_widget_class_bind_template_child (widget_class, TotemPreferencesDialog, tpw_plugins_button);
gtk_widget_class_bind_template_child (widget_class, TotemPreferencesDialog, tpw_saturation_adjustment);
gtk_widget_class_bind_template_child (widget_class, TotemPreferencesDialog, tpw_saturation_scale);