summaryrefslogtreecommitdiff
path: root/src/mpvoptions.cpp
diff options
context:
space:
mode:
authorMateusz Łukasik <mati75@linuxmint.pl>2017-05-28 22:58:38 +0200
committerMateusz Łukasik <mati75@linuxmint.pl>2017-05-28 22:58:38 +0200
commit8cd3e30b34e5ff62a993227c386ab77dd01fa1d4 (patch)
tree60ab5ccc720108feb6a82ad91c0d212f52e32a3b /src/mpvoptions.cpp
parent8fa0adcb32570bfa1f7e6a3b0411b6d789fda623 (diff)
New upstream version 17.5.0~ds0
Diffstat (limited to 'src/mpvoptions.cpp')
-rw-r--r--src/mpvoptions.cpp29
1 files changed, 26 insertions, 3 deletions
diff --git a/src/mpvoptions.cpp b/src/mpvoptions.cpp
index 2109792..e073aeb 100644
--- a/src/mpvoptions.cpp
+++ b/src/mpvoptions.cpp
@@ -185,9 +185,11 @@ void MPVProcess::setOption(const QString & option_name, const QVariant & value)
}
else
if (option_name == "loop") {
+ QString loop = "--loop";
+ if (isOptionAvailable("--loop-file")) loop = "--loop-file";
QString o = value.toString();
if (o == "0") o = "inf";
- arg << "--loop=" + o;
+ arg << loop + "=" + o;
}
else
if (option_name == "ass") {
@@ -352,6 +354,13 @@ void MPVProcess::setOption(const QString & option_name, const QVariant & value)
}
}
#endif
+
+ // Remove options (used by mplayer)
+ int pos = vo.indexOf(":");
+ if (pos > -1) vo = vo.left(pos);
+
+ if (vo == "gl") vo = "opengl";
+
arg << "--vo=" + vo + ",";
}
else
@@ -397,6 +406,11 @@ void MPVProcess::setOption(const QString & option_name, const QVariant & value)
}
#endif
}
+
+ // Remove options (used by mplayer)
+ int pos = ao.indexOf(":");
+ if (pos > -1) ao = ao.left(pos);
+
arg << "--ao=" + ao + ",";
}
else
@@ -614,9 +628,12 @@ void MPVProcess::addAF(const QString & filter_name, const QVariant & value) {
QString option = value.toString();
if (filter_name == "volnorm") {
+ /*
QString s = "drc";
if (!option.isEmpty()) s += "=" + option;
arg << "--af-add=" + s;
+ */
+ arg << "--af-add=lavfi=[acompressor]";
}
else
if (filter_name == "channels") {
@@ -864,7 +881,9 @@ void MPVProcess::enableExtrastereo(bool b) {
}
void MPVProcess::enableVolnorm(bool b, const QString & option) {
- if (b) writeToStdin("af add drc=" + option); else writeToStdin("af del drc=" + option);
+ //if (b) writeToStdin("af add drc=" + option); else writeToStdin("af del drc=" + option);
+ Q_UNUSED(option);
+ if (b) writeToStdin("af add lavfi=[acompressor]"); else writeToStdin("af del lavfi=[acompressor]");
}
void MPVProcess::setAudioEqualizer(const QString & values) {
@@ -892,7 +911,7 @@ void MPVProcess::setLoop(int v) {
case 0: o = "inf"; break;
default: o = QString::number(v);
}
- writeToStdin(QString("set loop %1").arg(o));
+ writeToStdin(QString("set loop-file %1").arg(o));
}
void MPVProcess::setAMarker(int sec) {
@@ -979,6 +998,10 @@ void MPVProcess::setOSDScale(double value) {
writeToStdin("set osd-scale " + QString::number(value));
}
+void MPVProcess::setOSDFractions(bool active) {
+ writeToStdin(QString("no-osd set osd-fractions %1").arg(active ? "yes" : "no"));
+}
+
void MPVProcess::changeVF(const QString & filter, bool enable, const QVariant & option) {
qDebug() << "MPVProcess::changeVF:" << filter << enable;