summaryrefslogtreecommitdiff
path: root/src/input/libdvdnav/decoder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/input/libdvdnav/decoder.c')
-rw-r--r--src/input/libdvdnav/decoder.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/input/libdvdnav/decoder.c b/src/input/libdvdnav/decoder.c
index c7d27eeb0..d10fe154e 100644
--- a/src/input/libdvdnav/decoder.c
+++ b/src/input/libdvdnav/decoder.c
@@ -18,7 +18,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: decoder.c,v 1.5 2002/09/04 11:07:47 mroi Exp $
+ * $Id: decoder.c,v 1.6 2003/02/20 16:01:58 mroi Exp $
*
*/
@@ -41,13 +41,14 @@ uint32_t vm_getbits(command_t *command, int start, int count) {
uint64_t bit_mask=0xffffffffffffffff; /* I could put -1 instead */
uint64_t examining = 0;
int32_t bits;
+
if (count == 0) return 0;
if ( ((count+start) > 64) ||
(count > 32) ||
(start > 63) ||
(count < 0) ||
- (start < 0) ){
+ (start < 0) ) {
fprintf(MSG_OUT, "libdvdnav: Bad call to vm_getbits. Parameter out of range\n");
assert(0);
}
@@ -101,7 +102,7 @@ static uint16_t eval_reg(command_t* command, uint8_t reg) {
if(reg & 0x80) {
if ((reg & 0x1f) == 20) {
fprintf(MSG_OUT, "libdvdnav: Suspected RCE Region Protection!!!");
- }
+ }
return command->registers->SPRM[reg & 0x1f]; /* FIXME max 24 not 32 */
} else {
return get_GPRM(command->registers, reg & 0x0f) ;
@@ -570,8 +571,7 @@ static int32_t eval_command(uint8_t *bytes, registers_t* registers, link_t *retu
return res;
}
-/* Evaluate a set of commands in the given register set (which is
- * modified */
+/* Evaluate a set of commands in the given register set (which is modified) */
int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
registers_t *registers, link_t *return_values) {
int32_t i = 0;
@@ -587,6 +587,7 @@ int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
fprintf(MSG_OUT, "libdvdnav: --------------------------------------------\n");
fprintf(MSG_OUT, "libdvdnav: Single stepping commands\n");
#endif
+
i = 0;
while(i < num_commands && total < 100000) {
int32_t line;
@@ -594,6 +595,7 @@ int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
#ifdef TRACE
vmPrint_CMD(i, &commands[i]);
#endif
+
line = eval_command(&commands[i].bytes[0], registers, return_values);
if (line < 0) { /* Link command */
@@ -621,6 +623,8 @@ int32_t vmEval_CMD(vm_cmd_t commands[], int32_t num_commands,
return 0;
}
+#ifdef TRACE
+
static char *linkcmd2str(link_cmd_t cmd) {
switch(cmd) {
case LinkNoLink:
@@ -762,3 +766,6 @@ void vmPrint_registers( registers_t *registers ) {
fprintf(MSG_OUT, "%04lx|", registers->GPRM_time[i].tv_sec & 0xffff);
fprintf(MSG_OUT, "\n");
}
+
+#endif
+