changeset 338:0dc09442ff9c src

added missing mutex around the code in dvdnav_clear() ; patch by Erik Hovland - erik hovland org
author nicodvb
date Sat, 19 Apr 2008 10:07:47 +0000
parents f08dbb15ece1
children d0bfcfa565b0
files dvdnav.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/dvdnav.c	Sat Apr 19 09:44:15 2008 +0000
+++ b/dvdnav.c	Sat Apr 19 10:07:47 2008 +0000
@@ -53,6 +53,7 @@
 static dvdnav_status_t dvdnav_clear(dvdnav_t * this) {
   /* clear everything except file, vm, mutex, readahead */
 
+  pthread_mutex_lock(&this->vm_lock);
   if (this->file) DVDCloseFile(this->file);
   this->file = NULL;
 
@@ -70,6 +71,7 @@
   this->cur_cell_time = 0;
 
   dvdnav_read_cache_clear(this->cache);
+  pthread_mutex_unlock(&this->vm_lock);
   
   return DVDNAV_STATUS_OK;
 }