by steep8 » Tue Aug 09, 2011 8:34 am
patch:
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/clhelp.cpp src/clhelp.cpp
--- src-orig/clhelp.cpp 2011-03-17 07:48:24 +0000
+++ src/clhelp.cpp 2011-03-17 10:18:28 +0000
@@ -88,14 +88,16 @@
"[-use-single-instance] [-not-use-single-instance] "
"[-close-at-end] [-no-close-at-end] [-fullscreen] [-no-fullscreen] "
"[-sub %5] [-pos x y] [-size %6 %7] "
+ "[-additional-mplayer-params %8]"
"[-add-to-playlist] [-help|--help|-h|-?] "
- "[[-playlist] %8] [[-playlist] %8]...")
+ "[[-playlist] %9] [[-playlist] %9]...")
.arg(app_name)
.arg(QObject::tr("directory"))
.arg(QObject::tr("action_name"))
.arg(QObject::tr("action_list"))
.arg(QObject::tr("subtitle_file"))
.arg(QObject::tr("width")).arg(QObject::tr("height"))
+ .arg(QObject::tr("mplayer-params"))
.arg(QObject::tr("media"));
QString s;
@@ -152,6 +154,9 @@
s += formatHelp( "-no-close-at-end", QObject::tr(
"the main window won't be closed when the file/playlist finishes."), html );
+ s += formatHelp( "-additional-mplayer-params", QObject::tr(
+ "the options will directly pass to mplayer."), html );
+
s += formatHelp( "-fullscreen", QObject::tr(
"the video will be played in fullscreen mode."), html );
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/core.cpp src/core.cpp
--- src-orig/core.cpp 2011-03-17 07:48:24 +0000
+++ src/core.cpp 2011-03-17 10:20:30 +0000
@@ -2295,6 +2295,15 @@
}
}
+ if (!pref->mplayer_additional_params.isEmpty()) {
+ QStringList args = MyProcess::splitArguments(pref->mplayer_additional_params);
+ QStringList::Iterator it = args.begin();
+ while( it != args.end() ) {
+ proc->addArgument( (*it) );
+ ++it;
+ }
+ }
+
// File to play
if (url_is_playlist) {
proc->addArgument("-playlist");
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/preferences.cpp src/preferences.cpp
--- src-orig/preferences.cpp 2011-03-17 07:48:24 +0000
+++ src/preferences.cpp 2011-03-17 08:26:00 +0000
@@ -124,6 +124,8 @@
file_settings_method = "hash"; // Possible values: normal & hash
+ mplayer_additional_params = "";
+
/* ***************
Drives (CD/DVD)
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/preferences.h src/preferences.h
--- src-orig/preferences.h 2011-03-17 07:48:24 +0000
+++ src/preferences.h 2011-03-17 08:25:23 +0000
@@ -125,6 +125,8 @@
QString file_settings_method; //!< Method to be used for saving file settings
+ QString mplayer_additional_params;
+
/* ***************
Drives (CD/DVD)
diff -ru -N -x '*.user' -x 'ui_*' -x release -x '*.Release' -x '*.Debug' -x debug -x Makefile -x '*.orig' -x '*.qm' -x svn_revision.h src-orig/smplayer.cpp src/smplayer.cpp
--- src-orig/smplayer.cpp 2011-03-17 07:48:24 +0000
+++ src/smplayer.cpp 2011-03-17 08:11:21 +0000
@@ -270,6 +270,16 @@
return ErrorArgument;
}
}
+ else
+ if (argument == "-mplayer-additional-params") {
+ if (n+1 < args.count()) {
+ n++;
+ Global::pref->mplayer_additional_params = args[n];
+ } else {
+ printf("Error: expected parameter for -mplayer-additional-params\r\n");
+ return ErrorArgument;
+ }
+ }
else {
// File
if (QFile::exists( argument )) {