Add start and stop callbacks for audio and video renderers

This commit is contained in:
Cameron Gutman committed 2017-05-21 12:50:53 -07:00
1 parent 92951e1309
commit 86447399a9
4 files changed
+53 -2

No files matched your search

+6
View File
@@ -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);