From subversion at mplayerhq.hu Sun Jun 10 18:53:58 2018 From: subversion at mplayerhq.hu (ib) Date: Sun, 10 Jun 2018 18:53:58 +0300 (EEST) Subject: [MPlayer-cvslog] r38110 - in trunk: mplayer.c mplayer.h Message-ID: <20180610155358.BA93068A832@ffbox0-bg.mplayerhq.hu> Author: ib Date: Sun Jun 10 18:53:58 2018 New Revision: 38110 Log: Define variable allow_playlist_parsing globally. This will allow the GUI to check for it and to decide whether a file selector filter for playlists should be provided. (It won't make sense to provide such filter if playlist parsing is disabled by MPlayer.) Modified: trunk/mplayer.c trunk/mplayer.h Modified: trunk/mplayer.c ============================================================================== --- trunk/mplayer.c Sun May 6 23:08:10 2018 (r38109) +++ trunk/mplayer.c Sun Jun 10 18:53:58 2018 (r38110) @@ -330,7 +330,7 @@ static char *prog_path; static int crash_debug; #endif -static int allow_playlist_parsing; +int allow_playlist_parsing; /* This header requires all the global variable declarations. */ #include "cfg-mplayer.h" Modified: trunk/mplayer.h ============================================================================== --- trunk/mplayer.h Sun May 6 23:08:10 2018 (r38109) +++ trunk/mplayer.h Sun Jun 10 18:53:58 2018 (r38110) @@ -43,6 +43,8 @@ extern int progbar_align; extern int auto_quality; extern int disable_gui_conf; +extern int allow_playlist_parsing; + extern int capture_dump; extern int stream_dump_type; extern char *stream_dump_name; From subversion at mplayerhq.hu Sun Jun 10 18:59:24 2018 From: subversion at mplayerhq.hu (ib) Date: Sun, 10 Jun 2018 18:59:24 +0300 (EEST) Subject: [MPlayer-cvslog] r38111 - trunk/gui/dialog/fileselect.c Message-ID: <20180610155924.4282168A892@ffbox0-bg.mplayerhq.hu> Author: ib Date: Sun Jun 10 18:59:24 2018 New Revision: 38111 Log: Don't unconditionally add a file selector playlist filter. If playlist parsing is disabled by MPlayer, playlist playback will be impossible. So check for it and omit the playlist filter in case the parsing is disabled. It would otherwise be confusing for the user to be able to select a playlist that won't play then. Modified: trunk/gui/dialog/fileselect.c Modified: trunk/gui/dialog/fileselect.c ============================================================================== --- trunk/gui/dialog/fileselect.c Sun Jun 10 18:53:58 2018 (r38110) +++ trunk/gui/dialog/fileselect.c Sun Jun 10 18:59:24 2018 (r38111) @@ -52,6 +52,7 @@ #include "config.h" #include "help_mp.h" #include "mpcommon.h" +#include "mplayer.h" #include "libavutil/common.h" #include "stream/stream.h" @@ -870,6 +871,7 @@ void ShowFileSelector(int type) fsList_items = NULL; for (i = 0; fsVideoAudioFilterNames[i][0]; i++) + if ((strcmp(fsVideoAudioFilterNames[i][0], MSGTR_GUI_FilterFilePlaylist) != 0) || allow_playlist_parsing) fsList_items = g_list_append(fsList_items, fsVideoAudioFilterNames[i][0]); k = fsLastVideoAudioFilterSelected; From subversion at mplayerhq.hu Sun Jun 10 19:00:09 2018 From: subversion at mplayerhq.hu (ib) Date: Sun, 10 Jun 2018 19:00:09 +0300 (EEST) Subject: [MPlayer-cvslog] r38112 - trunk/gui/dialog/fileselect.c Message-ID: <20180610160009.7094B68A8CF@ffbox0-bg.mplayerhq.hu> Author: ib Date: Sun Jun 10 19:00:09 2018 New Revision: 38112 Log: Cosmetic: Adjust indent. Modified: trunk/gui/dialog/fileselect.c Modified: trunk/gui/dialog/fileselect.c ============================================================================== --- trunk/gui/dialog/fileselect.c Sun Jun 10 18:59:24 2018 (r38111) +++ trunk/gui/dialog/fileselect.c Sun Jun 10 19:00:09 2018 (r38112) @@ -872,7 +872,7 @@ void ShowFileSelector(int type) for (i = 0; fsVideoAudioFilterNames[i][0]; i++) if ((strcmp(fsVideoAudioFilterNames[i][0], MSGTR_GUI_FilterFilePlaylist) != 0) || allow_playlist_parsing) - fsList_items = g_list_append(fsList_items, fsVideoAudioFilterNames[i][0]); + fsList_items = g_list_append(fsList_items, fsVideoAudioFilterNames[i][0]); k = fsLastVideoAudioFilterSelected; gtk_combo_set_popdown_strings(GTK_COMBO(List), fsList_items); From subversion at mplayerhq.hu Sun Jun 10 19:20:59 2018 From: subversion at mplayerhq.hu (ib) Date: Sun, 10 Jun 2018 19:20:59 +0300 (EEST) Subject: [MPlayer-cvslog] r38113 - in trunk: DOCS/man/de/mplayer.1 DOCS/man/en/mplayer.1 gui/app/cfg.c gui/dialog/preferences.c help/help_mp-de.h help/help_mp-en.h Message-ID: <20180610162059.6490A68A8EF@ffbox0-bg.mplayerhq.hu> Author: ib Date: Sun Jun 10 19:20:59 2018 New Revision: 38113 Log: Allow the GUI to overwrite option allow_playlist_parsing. Add GUI option support_playlists to be able to allow playlist parsing even if disabled by MPlayer. (Since GUI's playlist parsing only takes effect if the user explicitly loads a playlist file through the file selector's playlist filter, it can be assumed that they are knowing what they are doing. There will be no playlist parsing the user can't be aware of. Moreover, instead of having to enable dangerous playlist parsing in MPlayer's configuration file - and thus more or less unrestrictedly - parsing can be restricted to GUI usage this way.) Add an entry to the preference dialog where the new option can be configured. Additionally, update man pages. Modified: trunk/gui/app/cfg.c trunk/gui/dialog/preferences.c Changes in other areas also in this revision: Modified: trunk/DOCS/man/de/mplayer.1 trunk/DOCS/man/en/mplayer.1 trunk/help/help_mp-de.h trunk/help/help_mp-en.h Modified: trunk/gui/app/cfg.c ============================================================================== --- trunk/gui/app/cfg.c Sun Jun 10 19:00:09 2018 (r38112) +++ trunk/gui/app/cfg.c Sun Jun 10 19:20:59 2018 (r38113) @@ -251,6 +251,8 @@ static const m_option_t gui_opts[] = { { "ass_bottom_margin", &ass_bottom_margin, CONF_TYPE_INT, CONF_RANGE, 0, 2000, NULL }, #endif + { "playlist_support", &allow_playlist_parsing, CONF_TYPE_FLAG, 0, 0, 1, NULL }, + { NULL, NULL, 0, 0, 0, 0, NULL } }; Modified: trunk/gui/dialog/preferences.c ============================================================================== --- trunk/gui/dialog/preferences.c Sun Jun 10 19:00:09 2018 (r38112) +++ trunk/gui/dialog/preferences.c Sun Jun 10 19:20:59 2018 (r38113) @@ -116,6 +116,7 @@ static GtkWidget * CBStopXScreenSaver; static GtkWidget * CBPlayBar; static GtkWidget * CBNoIdle; static GtkWidget * CBTVDigital; +static GtkWidget * CBPlaylists; static GtkWidget * SBCache; static GtkAdjustment * SBCacheadj; @@ -382,6 +383,7 @@ static void prButton( GtkButton * button gtkEnablePlayBar=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPlayBar ) ); 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,HSPPQualityadj->value,0 ); if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=True; } @@ -1092,6 +1094,7 @@ static GtkWidget * CreatePreferences( vo CBStopXScreenSaver=gtkAddCheckButton( MSGTR_GUI_TurnOffXScreenSaver,vbox602 ); CBPlayBar=gtkAddCheckButton( MSGTR_GUI_EnablePlaybar,vbox602 ); CBTVDigital=gtkAddCheckButton( MSGTR_GUI_EnableDigitalTV,vbox602 ); + CBPlaylists = gtkAddCheckButton(MSGTR_GUI_PlaylistSupport, vbox602); CBNoIdle=gtkAddCheckButton( MSGTR_GUI_QuitAfterPlaying,vbox602 ); gtkAddHSeparator( vbox602 ); @@ -1411,6 +1414,7 @@ void ShowPreferences( void ) gtk_widget_set_sensitive( CBTVDigital,FALSE ); #endif gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNoIdle ),!player_idle_mode ); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CBPlaylists), allow_playlist_parsing); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBCache ),0 ); gtk_adjustment_set_value( SBCacheadj,gtkCacheSize );