Detach/Attach on MakePrimaryDevice.

This commit is contained in:
Johns 2012-03-02 00:22:08 +01:00
parent 0df8e8a5fc
commit db258a0fbd
1 changed files with 8 additions and 0 deletions

View File

@ -927,6 +927,13 @@ void cSoftHdDevice::MakePrimaryDevice(bool on)
cDevice::MakePrimaryDevice(on); cDevice::MakePrimaryDevice(on);
if (on) { if (on) {
new cSoftOsdProvider(); new cSoftOsdProvider();
if (SuspendMode == SUSPEND_DETACHED) {
Resume();
SuspendMode = 0;
}
} else if (!SuspendMode) {
Suspend(1, 1, 0);
SuspendMode = SUSPEND_DETACHED;
} }
} }
@ -1698,6 +1705,7 @@ cString cPluginSoftHdDevice::SVDRPCommand(const char *command,
return "can't suspend SoftHdDevice already suspended"; return "can't suspend SoftHdDevice already suspended";
} }
Suspend(1, 1, 0); Suspend(1, 1, 0);
SuspendMode = SUSPEND_DETACHED;
cControl::Launch(new cSoftHdControl); cControl::Launch(new cSoftHdControl);
cControl::Attach(); cControl::Attach();
return "SoftHdDevice is detached"; return "SoftHdDevice is detached";