[vdr] [RFC] Shutdown rewrite for 1.5.x

Marko Mäkelä marko.makela at hut.fi
Wed Feb 7 23:12:44 CET 2007


On Wed, Feb 07, 2007 at 10:40:44PM +0100, Udo Richter wrote:
> Marko Mäkelä wrote:
> >>You can shut down while playback, you just have to confirm it. And if 
> >>you don't confirm it, VDR will shut down 5 minutes after the playback 
> >>ends.
> >
> >Sure, if the playback ends.  It won't end with my patched softdevice
> >that stops the playback of recordings when Shutdown.IsUserInactive()
> >returns true.
> 
> I do understand this right: If your softdevice detects IsUserInactive, 
> then it sends a 'stop playback' to VDR? Weired...

It doesn't actually send anything to VDR; it'll just return 0 from
cDevice::PlayVideo() and cDevice::PlayAudio().  It will also have to
sleep a little, because otherwise VDR would use 100% of CPU.

> I guess the most natural behavior would be to pretend that you're 
> playing back normally, eg. make softdevice eat the incoming data stream 
> at normal speed without decoding it.

Well, that would still break this scenario: You're watching a recording
while it is being recorded.  Then you get interrupted and push the Power
button.  Before the timed recording finishes and VDR gets a chance to
shut down, you get back and push a button to switch to interactive state.
You will be surprised to see that the playback doesn't resume from the
same position.

> >Then, VDR wouldn't shut down unexpectedly while playing back
> >a recording even if the inactivity timeout kicks in.  But VDR wouldn't
> >ask for confirmation when pressing the Power key.  Thus, no new
> >configuration option would be necessary.
> 
> More easy, just drop the playback check completely. A running playback 
> means that the !Interact check in vdr.c will prevent any housekeeping 
> and thus automatic shutdown.

Before writing my previous message, I added #if 0 #endif around the
NowReplaying() check in shutdown.c, and it seems to work.  VDR will be
powered off during playback if there is no timed recording going on.

> But again, that way you cannot get VDR into inactive mode manually while 
> playback.

Is that feature necessary?  If you believe so, maybe you could introduce
a configuration option for enabling it?  The default behaviour would be
to obey the Power button immediately.  The option could be named
something like "Shutdown during playback must be confirmed".

	Marko



More information about the vdr mailing list