summaryrefslogtreecommitdiff
path: root/src/input/libdvdnav/dvdnav.c
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-09-20 12:53:53 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-09-20 12:53:53 +0000
commit0c7d2678ef70026fa05b3b0921a149d1c0e5ebfb (patch)
tree534a685276a6f33fe77692a721530a927b95185c /src/input/libdvdnav/dvdnav.c
parent44a2823e79fcf9b1002f7bf537fc9c7a9b7913b3 (diff)
downloadxine-lib-0c7d2678ef70026fa05b3b0921a149d1c0e5ebfb.tar.gz
xine-lib-0c7d2678ef70026fa05b3b0921a149d1c0e5ebfb.tar.bz2
sync to latest libdvdnav cvs version
CVS patchset: 2718 CVS date: 2002/09/20 12:53:53
Diffstat (limited to 'src/input/libdvdnav/dvdnav.c')
-rw-r--r--src/input/libdvdnav/dvdnav.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/input/libdvdnav/dvdnav.c b/src/input/libdvdnav/dvdnav.c
index d1a4e7318..7e209d3a8 100644
--- a/src/input/libdvdnav/dvdnav.c
+++ b/src/input/libdvdnav/dvdnav.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: dvdnav.c,v 1.7 2002/09/04 11:07:47 mroi Exp $
+ * $Id: dvdnav.c,v 1.8 2002/09/20 12:53:53 mroi Exp $
*
*/
@@ -40,6 +40,8 @@
#include <stdio.h>
#include <sys/time.h>
+#include "remap.h"
+
/*
* NOTE:
* All NLCK_*() function are not mutex locked, this made them reusable in
@@ -179,11 +181,8 @@ dvdnav_status_t dvdnav_open(dvdnav_t** dest, char *path) {
struct timeval time;
/* Create a new structure */
- fprintf(MSG_OUT, "libdvdnav: Using dvdnav version (devel-ref:jcd1) from http://xine.sf.net\n");
+ fprintf(MSG_OUT, "libdvdnav: Using dvdnav version %s from http://xine.sf.net\n", VERSION);
- /* FIXME: We malloc() here, but if an error occurs inside dvdnav_open(),
- * we return but never free() it.
- */
(*dest) = NULL;
this = (dvdnav_t*)malloc(sizeof(dvdnav_t));
if(!this)
@@ -199,10 +198,15 @@ dvdnav_status_t dvdnav_open(dvdnav_t** dest, char *path) {
this->vm = vm_new_vm();
if(!this->vm) {
printerr("Error initialising the DVD VM");
+ pthread_mutex_destroy(&this->vm_lock);
+ free(this);
return S_ERR;
}
if(vm_reset(this->vm, path) == -1) {
printerr("Error starting the VM / opening the DVD device");
+ pthread_mutex_destroy(&this->vm_lock);
+ vm_free_vm(this->vm);
+ free(this);
return S_ERR;
}
@@ -593,13 +597,13 @@ dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, unsigned char **buf,
fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_letterbox=%d\n",stream_change.physical_letterbox);
fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_pan_scan=%d\n",stream_change.physical_pan_scan);
#endif
- pthread_mutex_unlock(&this->vm_lock);
if (stream_change.physical_wide != -1 &&
stream_change.physical_letterbox != -1 &&
stream_change.physical_pan_scan != -1) {
#ifdef LOG_DEBUG
fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning S_OK\n");
#endif
+ pthread_mutex_unlock(&this->vm_lock);
return S_OK;
}
}
@@ -782,6 +786,14 @@ dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, unsigned char **buf,
/* Perform the jump if necessary (this is always a
* VOBU boundary). */
+ if (this->vm->map) {
+ this->vobu.vobu_next = remap_block( this->vm->map,
+ this->vm->state.domain, this->vm->state.TTN_REG,
+ this->vm->state.pgN,
+ this->vobu.vobu_start, this->vobu.vobu_next);
+ }
+
+
//result = DVDReadBlocks(this->file, this->vobu.vobu_start + this->vobu.vobu_next, 1, buf);
result = dvdnav_read_cache_block(this->cache, this->vobu.vobu_start + this->vobu.vobu_next, 1, buf);
@@ -998,6 +1010,9 @@ uint32_t dvdnav_get_next_still_flag(dvdnav_t *this) {
/*
* $Log: dvdnav.c,v $
+ * Revision 1.8 2002/09/20 12:53:53 mroi
+ * sync to latest libdvdnav cvs version
+ *
* Revision 1.7 2002/09/04 11:07:47 mroi
* sync to libdvdnav cvs
*