kopia lustrzana https://gitlab.com/eliggett/wfview
If audio device fails to open, retry 10 times before giving up.
rodzic
22692a6897
commit
30f9574dd6
|
@ -208,6 +208,12 @@ bool rtHandler::init(audioSetup setup)
|
|||
}
|
||||
catch (RtAudioError& e) {
|
||||
qInfo(logAudio()) << "Error opening:" << QString::fromStdString(e.getMessage());
|
||||
// Try again?
|
||||
if (retryConnectCount < 10) {
|
||||
QTimer::singleShot(500, this, std::bind(&rtHandler::init, this, setup));
|
||||
retryConnectCount++;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <QAudioFormat>
|
||||
#include <QTime>
|
||||
#include <QMap>
|
||||
#include <QTimer>
|
||||
|
||||
|
||||
/* wfview Packet types */
|
||||
|
@ -108,6 +109,7 @@ private:
|
|||
bool isUnderrun = false;
|
||||
bool isOverrun = false;
|
||||
QMutex audioMutex;
|
||||
int retryConnectCount = 0;
|
||||
};
|
||||
|
||||
#endif // rtHandler_H
|
||||
|
|
Ładowanie…
Reference in New Issue