Skip to content

Commit

Permalink
Change media monitoring interval from 500ms to 5s
Browse files Browse the repository at this point in the history
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
Beirdo committed Jan 2, 2012
1 parent c93987e commit 1721fdf
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mythtv/libs/libmyth/mythmediamonitor.cpp
Expand Up @@ -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

Expand Down

0 comments on commit 1721fdf

Please sign in to comment.