summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-12 13:52:21 +0000
committeralbeu <albeu@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-04-12 13:52:21 +0000
commit95341f99cf656eaaf7149b17659e7a767062851a (patch)
tree2872f3e6a6669986bc6f3b569ffcfd8a9cba264a
parentda665dfe87e8df52dfaf900b1e64e013f83342e2 (diff)
downloadmpv-95341f99cf656eaaf7149b17659e7a767062851a.tar.bz2
mpv-95341f99cf656eaaf7149b17659e7a767062851a.tar.xz
mem mapped area need to be unmapped.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@9915 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--osdep/shmem.c9
-rw-r--r--osdep/shmem.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/osdep/shmem.c b/osdep/shmem.c
index 4339c89533..d697dc837d 100644
--- a/osdep/shmem.c
+++ b/osdep/shmem.c
@@ -94,8 +94,15 @@ while(1){
}
}
-void shmem_free(void* p){
+void shmem_free(void* p,int size){
switch(shmem_type){
+ case 0:
+ case 1:
+ if(munmap(p,size)) {
+ mp_msg(MSGT_OSDEP, MSGL_ERR, "munmap failed on %p %d bytes: %s\n",
+ p,size,strerror(errno));
+ }
+ break;
case 2:
#ifdef HAVE_SHM
if (shmdt(p) == -1)
diff --git a/osdep/shmem.h b/osdep/shmem.h
index 58ceee4e44..f3ed9b26bb 100644
--- a/osdep/shmem.h
+++ b/osdep/shmem.h
@@ -1,4 +1,4 @@
void* shmem_alloc(int size);
-void shmem_free(void* p);
+void shmem_free(void* p,int size);