Make MPV less verbose and make arg parsing better...
This commit is contained in:
parent
79599c32b2
commit
4dfb005d69
|
@ -169,7 +169,7 @@ MpvObject::MpvObject(QQuickItem * parent)
|
||||||
throw std::runtime_error("could not create mpv context");
|
throw std::runtime_error("could not create mpv context");
|
||||||
|
|
||||||
mpv_set_option_string(mpv, "terminal", "yes");
|
mpv_set_option_string(mpv, "terminal", "yes");
|
||||||
mpv_set_option_string(mpv, "msg-level", "all=v");
|
//mpv_set_option_string(mpv, "msg-level", "all=v");
|
||||||
|
|
||||||
if (mpv_initialize(mpv) < 0)
|
if (mpv_initialize(mpv) < 0)
|
||||||
throw std::runtime_error("could not initialize mpv context");
|
throw std::runtime_error("could not initialize mpv context");
|
||||||
|
|
|
@ -131,11 +131,11 @@ ApplicationWindow {
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
var args = Qt.application.arguments
|
var args = Qt.application.arguments
|
||||||
var len = Qt.application.arguments.length
|
var len = Qt.application.arguments.length
|
||||||
var argNo = 0
|
var argNo = 1
|
||||||
renderer.setOption("ytdl-format", "bestvideo[width<=" + Screen.width
|
renderer.setOption("ytdl-format", "bestvideo[width<=" + Screen.width
|
||||||
+ "][height<=" + Screen.height + "]+bestaudio")
|
+ "][height<=" + Screen.height + "]+bestaudio")
|
||||||
if (len > 1) {
|
if (len > 1) {
|
||||||
for (argNo = 0; argNo < len; argNo++) {
|
for (argNo = 1; argNo < len; argNo++) {
|
||||||
var argument = args[argNo]
|
var argument = args[argNo]
|
||||||
if (argument.startsWith("--")) {
|
if (argument.startsWith("--")) {
|
||||||
argument = argument.substr(2)
|
argument = argument.substr(2)
|
||||||
|
@ -215,7 +215,7 @@ ApplicationWindow {
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: pathText
|
id: pathText
|
||||||
text: "/home/kitteh/babyshark.mkv"
|
text: "/home/kitteh/test.mkv"
|
||||||
placeholderText: qsTr("URL / File Path")
|
placeholderText: qsTr("URL / File Path")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue