On Wed, 2005-04-27 at 09:31 +0100, Terry Barnaby wrote: > Hi, > I also notice that when a stream is removed in av_remove_stream():2099 > it manages its list of streams by moving up a complex data structure > with a memmove() routine. This is a potentialy very dangerous thing > to do with complex data structures containing pointers etc etc ... > Can anyone give me a run down on what actually is suposed to happen > when a channel is changed in MythTv when using DVB and TS streams ?
When a channel the recorder waits for any tables it needs then it waits for keyframe. Once it gets a keyframe it begins writing out the stream. But it rewrites the PAT table so that it contains just one program, and it rewrites the PMT table so that it describes the program listed in the PAT. So basically the PAT never changes, but the PMT changes to listen to the right streams for the current program. Meanwhile the frontend doesn't know what is going on with the recorder, but after the PMT changes in the stream the HandleStreamChange() call-back is called from within ffmpeg. This calls AVFormatDecoder's ScanStreams(). When it finds the new video stream it calls InitVideoCodec(), which in set's up the other callbacks within ffmpeg, and calls NVP's SetVideoParams(), which tells the VideoOutput class about the changes. Right now VideoOutput is informed of the change via NVP's ReinitVideo() which calls vo->InputChanged(). InputChanged() in turn deletes all the XvMC buffers and creates new ones. What should happen instead, as long as XvMC is still the right output type, is that VideoOutput should just note the change. It should then delete the old buffers and create new ones as each frame is requested by ffmpeg via the get_frame callback, displaying the already decoded buffers from before the channel change until they have been replaced with frames from the new stream. > The Video out should not need > any changes (aprat from size changes which would be being handled already). The size changes are done in InputChanged now, but should be done on a frame by frame basis. > Ant pointers to the higher levels of code where the channel change is > implemented ?? The video output method doesn't care at all about the channel change, it is treated the same way as just a normal PMT change due to a new program, commercials, etc. -- Daniel
_______________________________________________ mythtv-dev mailing list mythtv-dev@mythtv.org http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev