1
0
mirror of https://github.com/chylex/TweetDuck.git synced 2025-06-19 12:39:55 +02:00

Fix a video player crash caused by not handling remote commands on UI thread

This commit is contained in:
chylex 2018-01-29 08:20:33 +01:00
parent f909b887d9
commit b290c94635

View File

@ -75,15 +75,17 @@ private void FormPlayer_Load(object sender, EventArgs e){
} }
private void pipe_DataIn(object sender, DuplexPipe.PipeReadEventArgs e){ private void pipe_DataIn(object sender, DuplexPipe.PipeReadEventArgs e){
switch(e.Key){ Invoke(new Action(() => {
case "key": switch(e.Key){
HandleKey((Keys)int.Parse(e.Data, NumberStyles.Integer)); case "key":
break; HandleKey((Keys)int.Parse(e.Data, NumberStyles.Integer));
break;
case "die": case "die":
StopVideo(); StopVideo();
break; break;
} }
}));
} }
private void player_PlayStateChange(int newState){ private void player_PlayStateChange(int newState){