[mythtv] mythplayer.cpp query

James Courtier-Dutton james.dutton at gmail.com
Fri Mar 16 09:10:47 UTC 2012

On 13 March 2012 11:00, Russell Gower <mythtv at thegowers.me.uk> wrote:
> Hi,
>  I'm looking at the code to see if I can reduce the 5-20 second pauses in live tv between program changes on the same channel, and have a query about two of the methods in MythPlayer.
> Am I right in thinking that SwitchToProgram handles the changeover at as one recording ends and another starts and that JumpToProgram handles the changeover when the user selects another channel?

I looked into this problem a long time ago. The work required to fix
the problem is too large.
Essentially, the problem is that myth goes through destroying all the
objects from the old channel choice, and then builds a new chain of
objects for the new channel. This destroy and re-create process takes
time because it waits for buffers to flush etc.

The only way to really fix this, is to keep one object chain there all
the time, and be able to apply configuration changes to the existing
chain. You then insert markers into the data stream, that they
themselves can act on the stream, or just help with the processing.
E.g. A marker to say channel changed. This will flow through the
record/playback chain so that the output of the record knows exactly
when to divert packets from one recording file to another. Also, the
playback chain can use it to know when to re-read the PAT/PMT etc. in
order to decode the correct PIDs.
Other markers can also be used in the stream, to, for example, flush
the fifo buffers along the chain. This is useful in the playback chain
to get the old buffers to clear so that the new channel appears
All this is used in "xine" to permit messages to be send in the stream
that need to be acted upon at a particular point in the stream.

So, until myth changes to use static reconfigurable object chains
instead of destroy then new object chains, what you want will probably
not happen.

Kind Regards


More information about the mythtv-dev mailing list