@@ -24,15 +24,13 @@ public class VideoMpvPlayer : IWallpaper
24
24
Process Proc { get ; set ; }
25
25
LibraryModel Model { get ; set ; }
26
26
LivelyScreen Display { get ; set ; }
27
- public UInt32 SuspendCnt { get ; set ; }
28
27
private readonly CancellationTokenSource ctsProcessWait = new CancellationTokenSource ( ) ;
29
28
private Task processWaitTask ;
30
29
private readonly int timeOut ;
31
30
private readonly string ipcServerName ;
32
31
JObject livelyPropertiesData ;
33
32
string LivelyPropertyCopy { get ; set ; }
34
33
35
- //todo: yt-dl support.
36
34
public VideoMpvPlayer ( string path , LibraryModel model , LivelyScreen display ,
37
35
WallpaperScaler scaler = WallpaperScaler . fill , StreamQualitySuggestion streamQuality = StreamQualitySuggestion . Highest )
38
36
{
@@ -84,24 +82,25 @@ public VideoMpvPlayer(string path, LibraryModel model, LivelyScreen display,
84
82
85
83
ipcServerName = "mpvsocket" + Path . GetRandomFileName ( ) ;
86
84
string cmdArgs =
87
- //always create gui window
88
- "--force-window=yes " +
85
+ "--volume=0 " +
89
86
//alternative: --loop-file=inf
90
87
"--loop-file " +
91
88
//do not close after media end
92
89
"--keep-open " +
93
- //gpu decode preferred
94
- "--hwdec=auto " +
90
+ //always create gui window
91
+ "--force-window=yes " +
92
+ //open window at (-9999,0)
93
+ "--geometry=-9999:0 " +
95
94
//allow screensaver
96
95
"--stop-screensaver=no " +
97
- //open window at (-9999,0)
98
- "--geometry=-9999:0 " +
99
96
//alternative: --input-ipc-server=\\.\pipe\
100
97
"--input-ipc-server=" + ipcServerName + " " +
101
98
//stretch algorithm
102
99
scalerArg + " " +
103
100
//integer scaler for sharpness
104
- ( model . LivelyInfo . Type == WallpaperType . gif ? "--scale=nearest " : " " ) +
101
+ ( model . LivelyInfo . Type == WallpaperType . gif ? "--scale=nearest " : " " ) +
102
+ //gpu decode preference
103
+ ( Program . SettingsVM . Settings . VideoPlayerHwAccel ? "--hwdec=auto " : "--hwdec=no " ) +
105
104
//file, stream path
106
105
( model . LivelyInfo . Type == WallpaperType . videostream ? Helpers . StreamHelper . YoutubeDLMpvArgGenerate ( streamQuality , path ) : "\" " + path + "\" " ) ;
107
106
@@ -122,7 +121,6 @@ public VideoMpvPlayer(string path, LibraryModel model, LivelyScreen display,
122
121
this . Model = model ;
123
122
this . Display = display ;
124
123
this . timeOut = 20000 ;
125
- SuspendCnt = 0 ;
126
124
}
127
125
128
126
public async void Close ( )
0 commit comments