diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-07-19 13:04:03 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2003-07-19 13:04:03 +0000 |
commit | d4c67c092ddcbef7ded5295f67701baa850ca533 (patch) | |
tree | 114fb3abca6ae7d1d8fdfa5d1e5da7bf02b0dbdb | |
parent | fab88fe9e4731aef2c371fb33522c4a8d114c1a7 (diff) | |
download | xine-lib-d4c67c092ddcbef7ded5295f67701baa850ca533.tar.gz xine-lib-d4c67c092ddcbef7ded5295f67701baa850ca533.tar.bz2 |
sync libdvdnav
CVS patchset: 5187
CVS date: 2003/07/19 13:04:03
-rw-r--r-- | src/input/libdvdnav/dvdnav.h | 8 | ||||
-rw-r--r-- | src/input/libdvdnav/nav_read.c | 31 | ||||
-rw-r--r-- | src/input/libdvdnav/vm.c | 4 | ||||
-rw-r--r-- | src/input/libdvdnav/vm.h | 4 |
4 files changed, 38 insertions, 9 deletions
diff --git a/src/input/libdvdnav/dvdnav.h b/src/input/libdvdnav/dvdnav.h index 0792f673d..6910506b6 100644 --- a/src/input/libdvdnav/dvdnav.h +++ b/src/input/libdvdnav/dvdnav.h @@ -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.h,v 1.13 2003/05/11 13:44:05 jcdutton Exp $ + * $Id: dvdnav.h,v 1.14 2003/07/19 13:04:03 mroi Exp $ * */ @@ -491,19 +491,19 @@ dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *self, pci_t *pci, int32_t x, int */ /* - * Set which menu language we should use. + * Set which menu language we should use per default. */ dvdnav_status_t dvdnav_menu_language_select(dvdnav_t *self, char *code); /* - * Set which audio language we should use. + * Set which audio language we should use per default. */ dvdnav_status_t dvdnav_audio_language_select(dvdnav_t *self, char *code); /* - * Set which spu language we should use. + * Set which spu language we should use per default. */ dvdnav_status_t dvdnav_spu_language_select(dvdnav_t *self, char *code); diff --git a/src/input/libdvdnav/nav_read.c b/src/input/libdvdnav/nav_read.c index eb5f3ae07..e4114034a 100644 --- a/src/input/libdvdnav/nav_read.c +++ b/src/input/libdvdnav/nav_read.c @@ -69,6 +69,11 @@ static uint32_t getbits(getbits_state_t *state, uint32_t number_of_bits) { byte = byte >> (8 - number_of_bits); result = byte; state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 8 */ + if (state->bit_position == 8) { + state->bit_position = 0; + state->byte_position++; + state->byte = state->start[state->byte_position]; + } number_of_bits = 0; } } @@ -91,8 +96,32 @@ static uint32_t getbits(getbits_state_t *state, uint32_t number_of_bits) { return result; } +/* WARNING: This function can only be used on a byte boundary. + No checks are made that we are in fact on a byte boundary. + */ +static uint16_t get16bits(getbits_state_t *state) { + uint16_t result; + state->byte_position++; + result = (state->byte << 8) + state->start[state->byte_position++]; + state->byte = state->start[state->byte_position]; + return result; +} + +/* WARNING: This function can only be used on a byte boundary. + No checks are made that we are in fact on a byte boundary. + */ +static uint32_t get32bits(getbits_state_t *state) { + uint32_t result; + state->byte_position++; + result = (state->byte << 8) + state->start[state->byte_position++]; + result = (result << 8) + state->start[state->byte_position++]; + result = (result << 8) + state->start[state->byte_position++]; + state->byte = state->start[state->byte_position]; + return result; +} + void navRead_PCI(pci_t *pci, unsigned char *buffer) { - int32_t result, i, j; + int32_t i, j; getbits_state_t state; if (getbits_init(&state, buffer)) assert(0); /* Passed NULL pointers */ diff --git a/src/input/libdvdnav/vm.c b/src/input/libdvdnav/vm.c index aaa254fe2..f646504fe 100644 --- a/src/input/libdvdnav/vm.c +++ b/src/input/libdvdnav/vm.c @@ -19,7 +19,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: vm.c,v 1.22 2003/05/26 23:11:44 miguelfreitas Exp $ + * $Id: vm.c,v 1.23 2003/07/19 13:04:03 mroi Exp $ * */ @@ -1228,7 +1228,6 @@ static int process_command(vm_t *vm, link_t link_values) { /* BUTTON number:data1 */ if(link_values.data1 != 0) (vm->state).HL_BTNN_REG = link_values.data1 << 10; - assert((vm->state).cellN > 1); (vm->state).cellN += 1; link_values = play_Cell(vm); break; @@ -1237,6 +1236,7 @@ static int process_command(vm_t *vm, link_t link_values) { /* BUTTON number:data1 */ if(link_values.data1 != 0) (vm->state).HL_BTNN_REG = link_values.data1 << 10; + assert((vm->state).cellN > 1); (vm->state).cellN -= 1; link_values = play_Cell(vm); break; diff --git a/src/input/libdvdnav/vm.h b/src/input/libdvdnav/vm.h index c289ddb3a..de5426611 100644 --- a/src/input/libdvdnav/vm.h +++ b/src/input/libdvdnav/vm.h @@ -19,7 +19,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: vm.h,v 1.9 2003/04/29 21:55:54 jcdutton Exp $ + * $Id: vm.h,v 1.10 2003/07/19 13:04:03 mroi Exp $ * */ @@ -116,7 +116,7 @@ typedef struct { #define PTL_REG registers.SPRM[13] /* Initialisation & destruction */ -vm_t *vm_new_vm(); +vm_t *vm_new_vm(void); void vm_free_vm(vm_t *vm); /* IFO access */ |