[MPlayer-dev-eng] [PATCH] fix: FreeDB file not fully downloaded

Mathieu SCHROETER mathieu.schroeter at gamesover.ch
Fri Nov 21 15:06:15 CET 2008


Hi,

a problem exists since a long time with cddb://. The files returned
by FreeDB are not always fully downloaded.
Then, the files saved in ~/.cddb/ are truncated in most of cases.

Today, I've found where is the problem but I'm not sure if
that will not break something else.

In http_read_response() "stream/network.c", do {} while (); line 267
is used to receive responses and it loop only one time in most of
cases, because the "while" condition is that HTTP header must
be entire.
But, the header is entire with the first loop and data after the
header are not fully downloaded (with my tests, I've about 1KB data
with the first loop and it is not enough for a lot of FreeDB files).


Then, the patch attached will read the socket until no more data
are available instead of quit the loop because only the HTTP
header is completed.

With this patch, I've no more problem to retrieve all titles
with `mplayer cddb://`.


Regards,
-- 
Mathieu SCHROETER


-------------- next part --------------
A non-text attachment was scrubbed...
Name: http_read_response-fix.patch
Type: text/x-diff
Size: 618 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20081121/bdb398a5/attachment.patch>


More information about the MPlayer-dev-eng mailing list