[mythtv] Small code improvement.
Isaac Richards
ijr at po.cwru.edu
Sat May 10 22:20:32 EDT 2003
On Saturday 10 May 2003 12:59 am, michael at optusnet.com.au wrote:
> In trying to work out why LiveTV was skipping occasionally
> I stumbled across a very odd piece of code.
>
> In RingBuffer.cpp, there's code to read from a remotefile.
> It _looks_ like it was supposed to maintain a window of
> requests ahead of the reads. Unfortunately, it's doesn't
> achieve that purpose.
No, that's not the intent. That _used_ to be how it worked, but with the
addition of the prebuffer thread, it's not used that way anymore.
> The patch below re-writes it to actually do something sane.
> It maintains a 'window' of about 1.5megabytes of requests
> in flight at any one time, sending new requests as reads
> consume 'in-flight' data.
So, this essentially adds a prebuffer to the prebuffer. Why not just increase
the size of the required amount of data in the prebuffer thread?
> Mythtv seems to be full of 'magic numbers' that aren't in
> configuration files. There's a magic number setting the
> videobuffer at 20megs for high res, and 12 meg for low res.
> There's another one setting the ring buffer size at 2 meg.
> There's yet another one setting the size of the audio
> buffer for playback. And yet another one setting the
> number of buffers available in playback. And another
> one setting the number of 'prebuffer' frames.
>
> Is there an intention to turn these into variable and move
> into a configuration file somewhere!?
Nope. People would break things by messing around with settings they don't
understand and then complain to the list =)
Isaac
More information about the mythtv-dev
mailing list