Skip to content

Commit

Permalink
Allow GetMountPath() to work when MediaMonitor disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelPearson committed Feb 21, 2011
1 parent f44c25a commit 9f479d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mythtv/libs/libmyth/mythmediamonitor.cpp
Expand Up @@ -518,6 +518,17 @@ QString MediaMonitor::GetMountPath(const QString& devPath)
mountPath = pMedia->getMountPath();
c_monitor->Unlock(pMedia);
}
// The media monitor could be inactive.
// Create a fake media device just to lookup mount map:
else
{
pMedia = MythCDROM::get(NULL, devPath.toAscii(), true, false);
if (pMedia && pMedia->findMountPath())
mountPath = pMedia->getMountPath();
else
VERBOSE(VB_MEDIA, "MediaMonitor::GetMountPath() - failed");
// need some way to delete the media device.
}
}

return mountPath;
Expand Down

0 comments on commit 9f479d8

Please sign in to comment.