mirror of https://github.com/mpv-player/mpv
Fix cache uninit
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9916 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
95341f99cf
commit
58ce0ac842
|
@ -196,6 +196,16 @@ cache_vars_t* cache_init(int size,int sector){
|
|||
return s;
|
||||
}
|
||||
|
||||
void cache_uninit(stream_t *s) {
|
||||
cache_vars_t* c = s->cache_data;
|
||||
if(!s->cache_pid) return;
|
||||
kill(s->cache_pid,SIGKILL);
|
||||
waitpid(s->cache_pid,NULL,0);
|
||||
if(!c) return;
|
||||
shmem_free(c->buffer,c->buffer_size);
|
||||
shmem_free(s->cache_data,sizeof(cache_vars_t));
|
||||
}
|
||||
|
||||
static void exit_sighandler(int x){
|
||||
// close stream
|
||||
exit(0);
|
||||
|
|
|
@ -391,10 +391,7 @@ void free_stream(stream_t *s){
|
|||
// printf("\n*** free_stream() called ***\n");
|
||||
#ifdef USE_STREAM_CACHE
|
||||
if(s->cache_pid) {
|
||||
// kill(s->cache_pid,SIGTERM);
|
||||
kill(s->cache_pid,SIGKILL);
|
||||
waitpid(s->cache_pid,NULL,0);
|
||||
shmem_free(s->cache_data);
|
||||
cache_uninit(s);
|
||||
}
|
||||
#endif
|
||||
switch(s->type) {
|
||||
|
|
Loading…
Reference in New Issue