[mythtv] Small code improvement.
bfoddy at visi.com
Sat May 10 01:25:30 EDT 2003
Wow, its almost as if you were reading my mind...
I too have noticed LiveTV pausing much more often than
recording/playback at the same resolution. Never got
around to researching why tho...
And as for the buffer settings, I have dabbled with changing
some of those buffer numbers myself as I too have 512MB,
with a dual tuner card and dual CPUs I feel more buffering
the better for my low Mhz cpus. However one could I think
argue that a fast single cpu would benefit even more from
increased buffer sizes so it could average out the peaks.
On Friday 09 May 2003 11:59 pm, 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.
> 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.
> It adds a new private variable to the RingBuffer object
> called 'requested' which is the count of data that's
> been requested but not consumed. It's reset to zero
> whenever a seek is done, the file is reset, or re-opened.
> I've also made worse something that annoys me a lot.
> 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!?
> (Given that I had 512Meg of ram on my media box, it makes
> a lot of sense to set some of these buffers much higher,
> but currently the only way to do that is stumble across
> the setting when reading the source code, and re-compile).
More information about the mythtv-dev