[MPlayer-cygwin] Re: TOOLS/netstream mingw patch

Erik Augustson erik_27can at yahoo.com
Wed Jun 23 23:36:53 CEST 2004


Song Du <freewizard <at> gmail.com> writes:

> 
> Suggest you apply the patch i posted a few days ago in order to make
> them really working correctly.
> 

Yep, i applied your patch when i came across it, it works well thank you. The
netstream server compiles and runs in linux (with a few additional tweaks, ie.
if i add -lz and -lasound and reconfigure it without gui, theora, and live.) but
this is an attempt to make a windows netstream.exe. This gets it to compile at
least under mingw, but as i said, i don't know how to C program really, so i
don't know how to make the unix to windows socket conversions.

I can run the netstream binary on my laptop, and stream files and dvd's (dvd
streaming is a little wonky) and access them on my desktop with a mingw build
that i did with your patch applied, but as Diego mentioned, the netstream code
has been neglected a little. With dvd's at least, it seems to run fine right up
until it finishes reading through the cache, then it starts to chop up really
bad. There might be a problem with how it's reading/filling cache. This is the
case with both a linux and windows build of mplayer. Secondly, the mingw client
will always spam "FIX ME? should lock here" and "FIX ME? should unlock here"
when using the cache because stream_netstream.c uses flock() and fcntl() which
are posix io's, and don't work in windows. They will work in Cygwin because
cygwin uses flock emulation which they borrowed from redhat i believe. You can
correct me if i'm wrong, which i probably am, but i was under the assumption
that cache2 used fork() and eliminated the need for file locking, so i was
curious if stream_netstream.c was even using cache2. When you pause it for a few
minutes, then unpause it, it will play back REAAALLY fast until it reads through
the cache, then chops up again.

Two last things, i had been enabling mpst:// in another place, which worked as
well. At roughly line 530 of open.c:

if (strcmp(url->protocol, "ftp")) { // ftp is handled somewhere else

to..

if (strcmp(url->protocol, "ftp") && strncmp("mpst://", filename, 7)) { // ftp..

I don't know if this does anything really, but it at least gets rid of the
"Warning! streams need a type" message when you access a netstream. In
stream_netstream.c at around 278:

*file_format = opened->file_format;
stream->flags = opened->flags;
stream->sector_size = opened->sector_size;

to..

*file_format = opened->file_format;
stream->type = STREAMTYPE_FILE;
stream->flags = opened->flags;
stream->sector_size = opened->sector_size;

I also tried STREAMTYPE_STREAM, but that seems to break the cache_fill.

Thx again,
Regards,
Erik





More information about the MPlayer-cygwin mailing list