summaryrefslogtreecommitdiffstats
path: root/libmpdemux/cache2.c
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-12 13:53:33 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-12 13:53:33 +0000
commit58ce0ac8425e64ea667aa402a0a6bdf140a31465 (patch)
treeccd39bcb4c35c7d856faf69afe42a7a95926b849 /libmpdemux/cache2.c
parent95341f99cf656eaaf7149b17659e7a767062851a (diff)
downloadmpv-58ce0ac8425e64ea667aa402a0a6bdf140a31465.tar.bz2
mpv-58ce0ac8425e64ea667aa402a0a6bdf140a31465.tar.xz
Fix cache uninit
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9916 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux/cache2.c')
-rw-r--r--libmpdemux/cache2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libmpdemux/cache2.c b/libmpdemux/cache2.c
index 2650ff2dbd..b4e82cb12b 100644
--- a/libmpdemux/cache2.c
+++ b/libmpdemux/cache2.c
@@ -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);