summaryrefslogtreecommitdiff
path: root/src/input/libdvdnav/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/libdvdnav/settings.c')
-rw-r--r--src/input/libdvdnav/settings.c62
1 files changed, 17 insertions, 45 deletions
diff --git a/src/input/libdvdnav/settings.c b/src/input/libdvdnav/settings.c
index c74eda500..bc5cc9e70 100644
--- a/src/input/libdvdnav/settings.c
+++ b/src/input/libdvdnav/settings.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: settings.c,v 1.2 2002/09/20 12:53:53 mroi Exp $
+ * $Id: settings.c,v 1.3 2003/02/20 16:02:01 mroi Exp $
*
*/
@@ -25,7 +25,6 @@
#include "config.h"
#endif
-#include <dvdnav.h>
#include "dvdnav_internal.h"
#include "vm.h"
@@ -33,57 +32,40 @@
/* Characteristics/setting API calls */
dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *this, int *region) {
- if(!this) {
- printerr("Passed a NULL this pointer");
- return S_ERR;
- }
-
- if(!region) {
- printerr("Passed a NULL region pointer");
- return S_ERR;
- }
-
- if(!this->vm) {
- printerr("VM not yet initialised");
+ if(!this || !region) {
+ printerr("Passed a NULL this pointer.");
return S_ERR;
}
(*region) = this->vm->state.registers.SPRM[20];
-
return S_OK;
}
dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *this, int mask) {
- if(!this)
- return S_ERR;
-
- if(!this->vm) {
- printerr("VM not yet initialised");
+ if(!this) {
+ printerr("Passed a NULL this pointer.");
return S_ERR;
}
+ pthread_mutex_lock(&this->vm_lock);
this->vm->state.registers.SPRM[20] = (mask & 0xff);
-
+ pthread_mutex_unlock(&this->vm_lock);
return S_OK;
}
dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *this, int use_readahead) {
- if(!this)
- return S_ERR;
+ if(!this) {
+ printerr("Passed a NULL this pointer.");
+ return S_ERR;
+ }
this->use_read_ahead = use_readahead;
-
return S_OK;
}
-dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int* flag) {
- if(!this) {
- printerr("Passed a NULL this pointer");
- return S_ERR;
- }
-
- if(!flag) {
- printerr("Passed a NULL flag pointer");
+dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int *flag) {
+ if(!this || !flag) {
+ printerr("Passed a NULL this pointer.");
return S_ERR;
}
@@ -92,23 +74,13 @@ dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *this, int* flag) {
}
static dvdnav_status_t set_language_register(dvdnav_t *this, char *code, int reg) {
- if(!this ) {
- printerr("Passed a NULL this pointer");
+ if(!this || !code) {
+ printerr("Passed a NULL this pointer.");
return S_ERR;
}
- if(!code) {
- printerr("Passed a NULL code pointer");
- return S_ERR;
- }
-
if(!code[0] || !code[1]) {
- printerr("Passed illegal language code");
- return S_ERR;
- }
-
- if(!this->vm) {
- printerr("VM not yet initialised");
+ printerr("Passed illegal language code.");
return S_ERR;
}