WASPI - Fix stream start after destroy (#241)
* waspi - Fix stream start after destroy * Fix stream name
This commit is contained in:
parent
95caa88cfa
commit
1a3a8956e4
|
@ -449,21 +449,27 @@ impl EventLoop {
|
|||
}
|
||||
},
|
||||
Command::PlayStream(stream_id) => {
|
||||
if let Some(v) = run_context.streams.get_mut(stream_id.0) {
|
||||
if !v.playing {
|
||||
let hresult = (*v.audio_client).Start();
|
||||
match run_context.streams.iter_mut().find(|v| v.id == stream_id) {
|
||||
None => continue,
|
||||
Some(stream) => {
|
||||
if !stream.playing {
|
||||
let hresult = (*stream.audio_client).Start();
|
||||
check_result(hresult).unwrap();
|
||||
v.playing = true;
|
||||
stream.playing = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
Command::PauseStream(stream_id) => {
|
||||
if let Some(v) = run_context.streams.get_mut(stream_id.0) {
|
||||
if v.playing {
|
||||
let hresult = (*v.audio_client).Stop();
|
||||
match run_context.streams.iter_mut().find(|v| v.id == stream_id) {
|
||||
None => continue,
|
||||
Some(stream) => {
|
||||
if stream.playing {
|
||||
let hresult = (*stream.audio_client).Stop();
|
||||
check_result(hresult).unwrap();
|
||||
v.playing = false;
|
||||
stream.playing = false;
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue