[MPlayer-dev-eng] [PATCH] (corrected) and test results

trevor-b at ovi.com trevor-b at ovi.com
Tue Mar 27 19:52:43 CEST 2012



I have now downloaded a bbc program 10 times, both before and after this patch was applied.
(The patch checks the error after a call to recv(...) in get_data() in asf_mmst_streaming.c.
If the errno was EAGAIN "Resource temporarily unavailable", keep trying, rather than give up)

Before applying the patch, the program failed to completely download the program in 4 out of 10 attempts.

There was one failure after applying the patch, this was due to similar problem elsewhere in mplayer.



I have recorded the start and end times for downloading a 30 min program, streamed in real time.  
All successful attempts should take almost exactly 30 mins, so programs with early finish times
 
have aborted prematurely

test times ....

before:
1.log:Started: Mon Mar 26 11:01:36 BST 2012 Finished: Mon Mar 26 11:31:44 BST 2012
2.log:Started: Mon Mar 26 11:31:44 BST 2012 Finished: Mon Mar 26 12:01:54 BST 2012
3.log:Started: Mon Mar 26 12:01:54 BST 2012 Finished: Mon Mar 26 12:32:02 BST 2012
4.log:Started: Mon Mar 26 12:32:02 BST 2012 Finished: Mon Mar 26 13:02:10 BST 2012
5.log:Started: Mon Mar 26 13:02:10 BST 2012 Finished: Mon Mar 26 13:05:18 BST 2012 ****** failed prematurely ******
6.log:Started: Mon Mar 26 13:05:18 BST 2012 Finished: Mon Mar 26 13:08:11 BST 2012 ****** failed prematurely ******
7.log:Started: Mon Mar 26 13:08:11 BST 2012 Finished: Mon Mar 26 13:10:23 BST 2012 ****** failed prematurely ******
8.log:Started: Mon Mar 26 13:10:23 BST 2012 Finished: Mon Mar 26 13:40:38 BST 2012
9.log:Started: Mon Mar 26 13:40:38 BST 2012 Finished: Mon Mar 26 13:43:46 BST 2012 ****** failed prematurely ******
10.log:Started: Mon Mar 26 13:43:46 BST 2012 Finished: Mon Mar 26 14:14:14 BST 2012

in all failed tests the error message was
read error:: Resource temporarily unavailable
pre-header read failed
(see my earlier posting)



after:
1.log:Started: Mon Mar 26 16:47:03 BST 2012 Finished: Mon Mar 26 17:17:17 BST 2012
2.log:Started: Mon Mar 26 17:17:17 BST 2012 Finished: Mon Mar 26 17:47:36 BST 2012
3.log:Started: Mon Mar 26 17:47:36 BST 2012 Finished: Mon Mar 26 18:17:45 BST 2012
4.log:Started: Mon Mar 26 18:17:45 BST 2012 Finished: Mon Mar 26 18:47:53 BST 2012
5.log:Started: Mon Mar 26 18:47:53 BST 2012 Finished: Mon Mar 26 19:18:01 BST 2012
6.log:Started: Mon Mar 26 19:18:01 BST 2012 Finished: Mon Mar 26 19:22:14 BST 2012 ****** failed prematurely ******
7.log:Started: Mon Mar 26 19:22:14 BST 2012 Finished: Mon Mar 26 19:53:09 BST 2012
8.log:Started: Mon Mar 26 19:53:09 BST 2012 Finished: Mon Mar 26 20:23:22 BST 2012
9.log:Started: Mon Mar 26 20:23:22 BST 2012 Finished: Mon Mar 26 20:53:32 BST 2012
10.log:Started: Mon Mar 26 20:53:32 BST 2012 Finished: Mon Mar 26 21:23:40 BST 2012

a big improvement.
The error in test 6 was ...
nop_streaming_read error : Resource temporarily unavailable
Error while reading network stream.

This is exactly the same problem as before, but this time it's in stream/network.c, around line 461.
Maybe a similar patch would have prevented this from failing as well.

Also, I added code to instrument how many retries (if any) were necessary.  Results are ...
1.elog:--- 1 retries neccessary
5.elog:--- 1 retries neccessary
5.elog:--- 1 retries neccessary
5.elog:--- 1 retries neccessary
5.elog:--- 1 retries neccessary
5.elog:--- 1 retries neccessary
5.elog:--- 1 retries neccessary
8.elog:--- 3 retries neccessary

In other words, the patch enabled 3 of the downloads to complete successfully.





----- Original Message -----

> 
> I'll do some more tests and post again in a couple of days time.
> 
> 
> 
> 
> ----- Original Message -----
>>  From: "trevor-b at ovi.com" <trevor-b at ovi.com>
>>  To: "mplayer-dev-eng at mplayerhq.hu" 
> <mplayer-dev-eng at mplayerhq.hu>
>>  Cc: 
>>  Sent: Friday, 23 March 2012, 22:12
>>  Subject: Re: [MPlayer-dev-eng] [PATCH] fix premature end of stream download
>> 
>>>   ... when recv returns 0, the other side closed the connection.
>>  what if recv returns < 0?  In my case, the call to perror prints 
> "read 
>>  error:: Resource temporarily unavailable"
>> 
>> 

>> 
>>  ----- Original Message -----
>>>   From: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
>>>   To: mplayer-dev-eng at mplayerhq.hu
>>>   Cc: 
>>>   Sent: Friday, 23 March 2012, 17:29
>>>   Subject: Re: [MPlayer-dev-eng] [PATCH] fix premature end of stream 
> download
>>> 
>>>   On Fri, Mar 23, 2012 at 09:59:17AM -0700, trevor-b at ovi.com wrote:
>>>>    Hi all,
>>>> 
>>>>    I have been listening to a BBC program, but mplayer nearly always 
> 
>>  aborts 
>>>   before finishing the download with this error message:
>>>> 
>>>>        read error:: Resource temporarily unavailable3% 1% 
>>>>        pre-header read failed
>>>>        Stream not seekable!
>>>> 
>>>>    In the sample output below, you can see the error occurred 11 
> mins 
>>  into a 2 
>>>   hr program.
>>>> 
>>>>    From the eror message, I'm guessing the problem happens 
> because 
>>  the 
>>>   data doesn't arrive fast enough, 
>>>> 
>>>>    so mplayer gives up.
>>>> 
>>>>    The corresponding code is in stream/asf_mmst_streaming.c, in 
> function 
>>>   get_data():
>>>> 
>>>>        len = recv (s, &buf[total], count-total, 0);
>>>>        if (len<=0) {
>>>>          perror ("read error:");
>>>>          return 0;
>>>>        }
>>>> 
>>>> 
>>>>    So it does give up as soon as there is no data available.
>>> 
>>>   No it does not, when recv returns 0, the other side closed the
>>>   connection.
>>> 
>>> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MPlayer-retry.patch
Type: application/octet-stream
Size: 622 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120327/75454e08/attachment.obj>


More information about the MPlayer-dev-eng mailing list