2013-01-29, 20:50
Perhaps something like this might work:
Code:
diff --git a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
index 2403bd1..81b372f 100644
--- a/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
+++ b/xbmc/cores/AudioEngine/Engines/SoftAE/SoftAE.cpp
@@ -39,6 +39,7 @@
#include "Interfaces/AESink.h"
#include "Utils/AEUtil.h"
#include "Encoders/AEEncoderFFmpeg.h"
+#include <unistd.h>
using namespace std;
@@ -74,7 +75,14 @@ CSoftAE::CSoftAE():
m_outputStageFn (NULL ),
m_streamStageFn (NULL )
{
+ unsigned int c_retry = 5;
CAESinkFactory::EnumerateEx(m_sinkInfoList);
+ while(m_sinkInfoList.size() == 0 && c_retry > 0)
+ {
+ CLog::Log(LOGNOTICE, "No Devices found - retry: %d", c_retry);
+ CAESinkFactory::EnumerateEx(m_sinkInfoList);
+ usleep(2000000);
+ c_retry--;
+ }
for (AESinkInfoList::iterator itt = m_sinkInfoList.begin(); itt != m_sinkInfoList.end(); ++itt)
{
CLog::Log(LOGNOTICE, "Enumerated %s devices:", itt->m_sinkName.c_str());