diff --git a/mythtv/libs/libmyth/mythmediamonitor.cpp b/mythtv/libs/libmyth/mythmediamonitor.cpp
index f459dfe..c5faccc 100644
a
|
b
|
MonitorThread::MonitorThread(MediaMonitor* pMon, unsigned long interval) : |
44 | 44 | { |
45 | 45 | m_Monitor = pMon; |
46 | 46 | m_Interval = interval; |
| 47 | m_lastCheckTime = QDateTime::currentDateTimeUtc(); |
47 | 48 | } |
48 | 49 | |
49 | 50 | // Nice and simple, as long as our monitor is valid and active, |
… |
… |
void MonitorThread::run(void) |
57 | 58 | { |
58 | 59 | m_Monitor->CheckDevices(); |
59 | 60 | m_Monitor->m_wait.wait(&mtx, m_Interval); |
| 61 | QDateTime now(QDateTime::currentDateTimeUtc()); |
| 62 | if (m_lastCheckTime.secsTo(now) > 60) |
| 63 | { |
| 64 | gCoreContext->ResetSockets(); |
| 65 | if (HasMythMainWindow()) |
| 66 | { |
| 67 | LOG(VB_GENERAL, LOG_INFO, "Restarting LIRC handler"); |
| 68 | GetMythMainWindow()->StartLIRC(); |
| 69 | } |
| 70 | } |
| 71 | m_lastCheckTime = now; |
60 | 72 | } |
61 | 73 | mtx.unlock(); |
62 | 74 | RunEpilog(); |
diff --git a/mythtv/libs/libmyth/mythmediamonitor.h b/mythtv/libs/libmyth/mythmediamonitor.h
index 66e8baa..bd681a3 100644
a
|
b
|
|
6 | 6 | #include <QMutex> |
7 | 7 | #include <QWaitCondition> |
8 | 8 | #include <QList> |
| 9 | #include <QDateTime> |
9 | 10 | |
10 | 11 | #include "mthread.h" |
11 | 12 | #include "mythexp.h" |
… |
… |
class MonitorThread : public MThread |
32 | 33 | protected: |
33 | 34 | QPointer<MediaMonitor> m_Monitor; |
34 | 35 | unsigned long m_Interval; |
| 36 | QDateTime m_lastCheckTime; |
35 | 37 | }; |
36 | 38 | |
37 | 39 | class MPUBLIC MediaMonitor : public QObject |
diff --git a/mythtv/libs/libmythbase/mythcorecontext.cpp b/mythtv/libs/libmythbase/mythcorecontext.cpp
index 703916c..26926a0 100644
a
|
b
|
void MythCoreContext::ResetLanguage(void) |
1731 | 1731 | d->language.clear(); |
1732 | 1732 | } |
1733 | 1733 | |
| 1734 | void MythCoreContext::ResetSockets(void) |
| 1735 | { |
| 1736 | QMutexLocker locker(&d->m_sockLock); |
| 1737 | LOG(VB_GENERAL, LOG_INFO, "Restarting Backend Connections"); |
| 1738 | if (d->m_serverSock) |
| 1739 | d->m_serverSock->DisconnectFromHost(); |
| 1740 | if (d->m_eventSock) |
| 1741 | d->m_eventSock->DisconnectFromHost(); |
| 1742 | dispatch(MythEvent("BACKEND_SOCKETS_CLOSED")); |
| 1743 | } |
| 1744 | |
1734 | 1745 | void MythCoreContext::InitLocale(void ) |
1735 | 1746 | { |
1736 | 1747 | if (!d->m_locale) |
diff --git a/mythtv/libs/libmythbase/mythcorecontext.h b/mythtv/libs/libmythbase/mythcorecontext.h
index 14d631c..4ca77e2 100644
a
|
b
|
class MBASE_PUBLIC MythCoreContext : public QObject, public MythObservable, publ |
202 | 202 | QString GetLanguage(void); |
203 | 203 | QString GetLanguageAndVariant(void); |
204 | 204 | void ResetLanguage(void); |
| 205 | void ResetSockets(void); |
205 | 206 | |
206 | 207 | void RegisterForPlayback(QObject *sender, const char *method); |
207 | 208 | void UnregisterForPlayback(QObject *sender); |
… |
… |
class MBASE_PUBLIC MythCoreContext : public QObject, public MythObservable, publ |
236 | 237 | void emitTVPlaybackAborted(void) { emit TVPlaybackAborted(); } |
237 | 238 | void emitTVPlaybackPlaying(void) { emit TVPlaybackPlaying(); } |
238 | 239 | |
| 240 | |
239 | 241 | signals: |
240 | 242 | void TVPlaybackStarted(void); |
241 | 243 | //// TVPlaybackStopped signal should be used in combination with |