[mythtv] Small code improvement.

Isaac Richards ijr at po.cwru.edu
Sun May 11 01:34:49 EDT 2003


On Saturday 10 May 2003 10:18 pm, michael at optusnet.com.au wrote:
> Indeed. I was looking at 0.8 and the CVS version is indeed different.
>
> Note that it's still useful on higher latency links to have the
> pre-fetch window there. Your max read rate is always proportional to
>
>          min( bandwidth , window_size / latency )
>
> so no matter how much read-ahead you do, you can't saturate a higher
> latency network link without windowing the requests. (given that a
> typical remote machine can have 20 ms or more of latency, I care
> about this :)

How's that?  All you're doing is stuffing data in the QSocket's internal 
buffer instead of storing it in the prebuffer thread's buffer.

> Would you object if I at least moved all the magic numbers to
> variable, and consolidated them in one place?

Yes.

> I'm finding some areas of the code very difficult to understand.
> Would you object to a patch to simplified some things, and added
> a bunch of comments?

Yes.

> I have rather a lot of unanswered questions. :)
>
> What does TransitionToFile do? (vs TransitionToRing?)
> (I.e. why does it exist?)

live tv -> recording (saving to a file) -> live tv

> In RingBuffer::safe_read(int,void*,int) when the read()
> gives EOF, why does it try another 20 times before
> failing? (I notice similar code in lots of other
> places).

read() doesn't tell you it's at eof, it just says it didn't read anything.  
You get the same return if you're reading at the end of a file and waiting 
for more data to fill.

Isaac


More information about the mythtv-dev mailing list