Permalink
Browse files

Change media monitoring interval from 500ms to 5s

It seems excessive to hit the CDROM drive every 500ms to see if media is
there or not.  Every 5s should do fine.  (Also moved the interval to a
macro (#define MONITOR_INTERVAL) to make it more maintainable).

Ideally, we should try to use dbus for this if possible (where supported)
and not poll at all.
  • Loading branch information...
1 parent c93987e commit 1721fdfa0de6d78a4a313000ac708c7ee584998d @Beirdo Beirdo committed Jan 2, 2012
Showing with 4 additions and 3 deletions.
  1. +4 −3 mythtv/libs/libmyth/mythmediamonitor.cpp
@@ -57,19 +57,20 @@ void MonitorThread::run(void)
////////////////////////////////////////////////////////////////////////
// MediaMonitor
+#define MONITOR_INTERVAL 5000
MediaMonitor* MediaMonitor::GetMediaMonitor(void)
{
if (c_monitor)
return c_monitor;
#ifdef USING_DARWIN_DA
- c_monitor = new MediaMonitorDarwin(NULL, 500, true);
+ c_monitor = new MediaMonitorDarwin(NULL, MONITOR_INTERVAL, true);
#else
#if CONFIG_CYGWIN || defined(_WIN32)
- c_monitor = new MediaMonitorWindows(NULL, 500, true);
+ c_monitor = new MediaMonitorWindows(NULL, MONITOR_INTERVAL, true);
#else
- c_monitor = new MediaMonitorUnix(NULL, 500, true);
+ c_monitor = new MediaMonitorUnix(NULL, MONITOR_INTERVAL, true);
#endif
#endif

0 comments on commit 1721fdf

Please sign in to comment.