Mercurial > libdvdnav.hg
comparison dvdnav.c @ 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 |
comparison
equal
deleted
inserted
replaced
337:f08dbb15ece1 | 338:0dc09442ff9c |
---|---|
51 #include "remap.h" | 51 #include "remap.h" |
52 | 52 |
53 static dvdnav_status_t dvdnav_clear(dvdnav_t * this) { | 53 static dvdnav_status_t dvdnav_clear(dvdnav_t * this) { |
54 /* clear everything except file, vm, mutex, readahead */ | 54 /* clear everything except file, vm, mutex, readahead */ |
55 | 55 |
56 pthread_mutex_lock(&this->vm_lock); | |
56 if (this->file) DVDCloseFile(this->file); | 57 if (this->file) DVDCloseFile(this->file); |
57 this->file = NULL; | 58 this->file = NULL; |
58 | 59 |
59 memset(&this->pci,0,sizeof(this->pci)); | 60 memset(&this->pci,0,sizeof(this->pci)); |
60 memset(&this->dsi,0,sizeof(this->dsi)); | 61 memset(&this->dsi,0,sizeof(this->dsi)); |
68 this->spu_clut_changed = 0; | 69 this->spu_clut_changed = 0; |
69 this->started = 0; | 70 this->started = 0; |
70 this->cur_cell_time = 0; | 71 this->cur_cell_time = 0; |
71 | 72 |
72 dvdnav_read_cache_clear(this->cache); | 73 dvdnav_read_cache_clear(this->cache); |
74 pthread_mutex_unlock(&this->vm_lock); | |
73 | 75 |
74 return DVDNAV_STATUS_OK; | 76 return DVDNAV_STATUS_OK; |
75 } | 77 } |
76 | 78 |
77 dvdnav_status_t dvdnav_open(dvdnav_t** dest, const char *path) { | 79 dvdnav_status_t dvdnav_open(dvdnav_t** dest, const char *path) { |