diff --git a/ChangeLog b/ChangeLog index d34ba7e..410ae46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ User johns Date: + Adds detached start mode. Fix bug: VDPAU looses preemption callback. Fix bug: X11 server keeps sending USR1 signals, which confuses suspend. Show message for hot-keys. diff --git a/softhddev.c b/softhddev.c index 2df19c9..1f0a453 100644 --- a/softhddev.c +++ b/softhddev.c @@ -2198,7 +2198,8 @@ const char *CommandLineHelp(void) "\tno-hw-decoder\t\tdisable hw decoder, use software decoder only\n" "\tno-mpeg-hw-decoder\tdisable hw decoder for mpeg only\n" "\talsa-driver-broken\tdisable broken alsa driver message\n" - "\tignore-repeat-pict\tdisable repeat pict message\n"; + "\tignore-repeat-pict\tdisable repeat pict message\n" + " -D\t\tstart in detached mode\n"; } /** @@ -2250,6 +2251,9 @@ int ProcessArgs(int argc, char *const argv[]) case 's': // start in suspend mode ConfigStartSuspended = 1; continue; + case 'D': // start in detached mode + ConfigStartSuspended = -1; + continue; case 'w': // workarounds if (!strcasecmp("no-hw-decoder", optarg)) { } else if (!strcasecmp("no-mpeg-hw-decoder", optarg)) { @@ -2440,6 +2444,10 @@ void SoftHdDeviceExit(void) /** ** Prepare plugin. +** +** @retval 0 normal start +** @retval 1 suspended start +** @retval -1 detached start */ int Start(void) { @@ -2469,9 +2477,11 @@ int Start(void) #ifndef NO_TS_AUDIO PesInit(PesDemuxAudio); #endif - Info(_("[softhddev] ready%s\n"), ConfigStartSuspended ? " suspended" : ""); + Info(_("[softhddev] ready%s\n"), + ConfigStartSuspended ? ConfigStartSuspended == + -1 ? "detached" : " suspended" : ""); - return !ConfigStartSuspended; + return ConfigStartSuspended; } /** diff --git a/softhddevice.cpp b/softhddevice.cpp index a9c19a8..a707516 100644 --- a/softhddevice.cpp +++ b/softhddevice.cpp @@ -1537,10 +1537,18 @@ bool cPluginSoftHdDevice::Start(void) } } - if (!::Start()) { - cControl::Launch(new cSoftHdControl); - cControl::Attach(); - SuspendMode = SUSPEND_NORMAL; + switch (::Start()) { + case 1: + cControl::Launch(new cSoftHdControl); + cControl::Attach(); + SuspendMode = SUSPEND_NORMAL; + break; + case -1: + SuspendMode = SUSPEND_DETACHED; + break; + case 0: + default: + break; } return true;