2006-12-21, 11:43 PM
My plugin creates a process to run an external program (VLC) that transcodes a network stream to disk. Normally, if the user exits from the plugin (or from the playback of the transcoded file), I kill the process to stop the recording. However, if GB-PVR terminates abnormally (or the user simply closes the GB-PVR window), the process continues as an orphan (or should that be "zombie" - I'm never sure of the difference) and, since the stream continues to be received, the process will continue transcoding it until the disk is full. Not good. :eek:
I can't seem to find any way in C# of forcing a child process to die when its parent dies. Nor can I find a Win32 solution (at least not an obvious one from random googling). I can set some arbitrary time limit in the VLC transcode command that would ensure that it doesn't continue infinitely but it seems like an ugly solution (Pretty annoying to be watching a video stream and have it suddenly stop because it hit the time limit).
Is there an elegant solution?
I can't seem to find any way in C# of forcing a child process to die when its parent dies. Nor can I find a Win32 solution (at least not an obvious one from random googling). I can set some arbitrary time limit in the VLC transcode command that would ensure that it doesn't continue infinitely but it seems like an ugly solution (Pretty annoying to be watching a video stream and have it suddenly stop because it hit the time limit).
Is there an elegant solution?
[SIZE=1]GBPVR v1.3.11 [/SIZE][SIZE=1]HVR-1250, [/SIZE][SIZE=1]ES7300[/SIZE][SIZE=1], 4GB, GeForce 9300, LianLi, Vista.[/SIZE]
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]
Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.
[SIZE=1]GBPVR v1.0.08 [/SIZE][SIZE=1]PVR-150, [/SIZE][SIZE=1]P4 2.26GHz, [/SIZE][SIZE=1]1GB,[/SIZE][SIZE=1] GeForce 6200, [/SIZE]Coupden, XP[SIZE=1]
[/SIZE]
Author: UbuStream plugin, UbuRadio plugin, EPGExtra utility.