[MPlayer-users] uninit player bug under win32
Malkovsky Sergey
sergei at as.khb.ru
Mon Oct 8 15:42:44 CEST 2007
Hi all.
Sometimes player freezes on exit, when you use cache. To reproduce this
bug start MPlayer with big cache (-cache 256000 -cache-min 90) and right
after that (or at the time when cache filling) press "q". Rarely bug
appear on exit when file playing (also with cache).
It's possible to exit from console player (when it hungs up) pressing
^c. In such case, this expected message appears: "MPlayer interrupted by
signal 2 in module: uninit_stream".
I've tried to solve this problem and found that bug appears at the
moment, when file descriptor is released (at uninit_stream section):
./stream/stream.c:431
void free_stream(stream_t *s){
// printf("\n*** free_stream() called ***\n");
#ifdef USE_STREAM_CACHE
if(s->cache_pid) {
cache_uninit(s);
}
#endif
if(s->close) s->close(s);
if(s->fd>0){
/* on unix we define closesocket to close
on windows however we have to distinguish between
network socket and file */
if(s->url && strstr(s->url,"://"))
closesocket(s->fd);
else close(s->fd); //BUG appears here
}
#ifdef HAVE_WINSOCK2
mp_msg(MSGT_STREAM,MSGL_V,"WINSOCK2 uninit\n");
WSACleanup(); // there might be a better place for this (-> later)
#endif
// Disabled atm, i don't like that. s->priv can be anything after all
// streams should destroy their priv on close
//if(s->priv) free(s->priv);
if(s->url) free(s->url);
free(s);
}
If file descriptor is not released (by comment this line) - this bug
disappears, but i think this is not good solution.
Bug summary:
OS: only Windows (I've tried WinXP SP1 and SP2), under Linux all ok.
MPlayer versions: from rc1 (I've not tested older versions) to current svn.
Have anyone any ideas?
Thank you in advance,
Sergey.
More information about the MPlayer-users
mailing list