From 40a7cdb8826a85cc6dc32f14f9431bca469285ea Mon Sep 17 00:00:00 2001 From: gary Date: Thu, 9 Nov 2023 16:36:21 -0800 Subject: [PATCH] pass some vlc settings --- MossCast/StreamerGroupBox.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/MossCast/StreamerGroupBox.cs b/MossCast/StreamerGroupBox.cs index 8e4c0a8..6bd6728 100644 --- a/MossCast/StreamerGroupBox.cs +++ b/MossCast/StreamerGroupBox.cs @@ -238,12 +238,16 @@ public List getStreamQuality(string streamer) public void genStream(string streamer, string quality, string windowTitle) { + var (width, height, xPos, yPos) = GetWindowLocation(); + string vlcOptions = @"--config %AppData%\MossCast\vlcrc --no-qt-video-autoresize --no-qt-privacy-ask --video-x " + xPos + " --video-y " + yPos + " --width " + width + " --height " + height; + string cmdOptions = @"-a "" " + vlcOptions + @" -"" --title " + windowTitle + " --hls-live-edge 1 twitch.tv/" + streamer + " " + quality; + var proc = new Process { StartInfo = new ProcessStartInfo { FileName = "streamlink", - Arguments = @"-a "" --config %AppData%\MossCast\vlcrc --no-qt-privacy-ask -"" " + " --title " + windowTitle + " --hls-live-edge 1 twitch.tv/" + streamer + quality, + Arguments = cmdOptions, UseShellExecute = false, RedirectStandardOutput = true, CreateNoWindow = true @@ -320,8 +324,7 @@ private void btnLaunch_Click(object sender, EventArgs e) return; } - string strQuality = " " + cbQuality.SelectedItem ?? "best" + " "; - genStream(streamer: streamerInfo.name, quality: strQuality, windowTitle: windowTitle); + genStream(streamer: streamerInfo.name, quality: (string)cbQuality.SelectedItem ?? "best", windowTitle: windowTitle); }