mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-12-03 03:31:27 +00:00
Add start and stop callbacks for audio and video renderers
This commit is contained in:
1 parent
92951e1309
commit
86447399a9
4 files changed
+53
-2
No files matched your search
@@ -250,6 +250,8 @@ static void DecoderThreadProc(void* context) {
|
||||
}
|
||||
|
||||
void stopAudioStream(void) {
|
||||
AudioCallbacks.stop();
|
||||
|
||||
PltInterruptThread(&udpPingThread);
|
||||
PltInterruptThread(&receiveThread);
|
||||
if ((AudioCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
|
||||
@@ -301,8 +303,11 @@ int startAudioStream(void) {
|
||||
return err;
|
||||
}
|
||||
|
||||
AudioCallbacks.start();
|
||||
|
||||
err = PltCreateThread(ReceiveThreadProc, NULL, &receiveThread);
|
||||
if (err != 0) {
|
||||
AudioCallbacks.stop();
|
||||
PltInterruptThread(&udpPingThread);
|
||||
PltJoinThread(&udpPingThread);
|
||||
PltCloseThread(&udpPingThread);
|
||||
@@ -314,6 +319,7 @@ int startAudioStream(void) {
|
||||
if ((AudioCallbacks.capabilities & CAPABILITY_DIRECT_SUBMIT) == 0) {
|
||||
err = PltCreateThread(DecoderThreadProc, NULL, &decoderThread);
|
||||
if (err != 0) {
|
||||
AudioCallbacks.stop();
|
||||
PltInterruptThread(&udpPingThread);
|
||||
PltInterruptThread(&receiveThread);
|
||||
PltJoinThread(&udpPingThread);
|
||||
|
||||
Reference in new issue
Block a user