[mythtv-users] Remote mythfrontend displays no video

Bruce Markey bjm at lvcm.com
Sun May 4 14:54:05 EDT 2003


Isaac Richards wrote:
> On Saturday 03 May 2003 04:05 pm, Bruce Markey wrote:
> 
>>This patch is a workaround that prevents WriteBlock from
>>returning until the write queue is below a threshold. I'm
>>still trying to find the exact cause of the file header not
>>being read correctly before applying a fix for the specific
>>problem.
>>
>>Please let me know if this patch fixes your problem.
> 
> 
> Does reverting to the old code fix things for you? I just replaced it because 
> bytesToWrite() was always 0 for me after the flush, so I figured it was silly 
> to have the loop there in the first place..  Could always replace it with 
> something like:
> 
>   while (socket->bytesToWrite() > 0)
>   {
>       socket->flush();
>       if (socket->bytesToWrite() > 0)
>          usleep(1000);
>   }

Waiting until the bytes have been written before processing
the next RequestBlock does work around the problem. However,
the root cause was RemoteFile::Seek() failed to drian all the
old data if the network was slow and the the queue was long.
I fixed this by looping until no more data is found on the
socket. In testing, this sometimes took three or more
iterations.

For WriteBlock, I think flush only needs to be called once
then simply wait for the packets to be sent on the network. 
Before these fixes I would see bytesToWrite grow to over 2MB
if it continued to process RequestBlocks without waiting. The
fix is to wait until there are fewer bytes in the queue than
the size of the current write. This prevents the queue from
growing unchecked but still returns to start processing the
next request so that the pipeline keeps moving.

--  bjm





More information about the mythtv-users mailing list