# HG changeset patch # User jcdutton # Date 1052615620 0 # Node ID 6b1bfe8f5283cb9ec7c3f1f0a796a1d0d5e04b36 # Parent 0ee10bd2292a53fcf73e015a37d9cd8433e7e0e7 Start some cleanups. diff -r 0ee10bd2292a -r 6b1bfe8f5283 decoder.c --- a/decoder.c Sun May 11 00:53:28 2003 +0000 +++ b/decoder.c Sun May 11 01:13:40 2003 +0000 @@ -35,7 +35,7 @@ #include "dvdnav_internal.h" -uint32_t vm_getbits(command_t *command, int start, int count) { +uint32_t vm_getbits(command_t *command, int32_t start, int32_t count) { uint64_t result = 0; uint64_t bit_mask = 0; uint64_t examining = 0; diff -r 0ee10bd2292a -r 6b1bfe8f5283 decoder.h --- a/decoder.h Sun May 11 00:53:28 2003 +0000 +++ b/decoder.h Sun May 11 01:13:40 2003 +0000 @@ -101,11 +101,11 @@ /* the big VM function, executing the given commands and writing * the link where to continue, the return value indicates if a jump * has been performed */ -int vmEval_CMD(vm_cmd_t commands[], int num_commands, +int vmEval_CMD(vm_cmd_t commands[], int32_t num_commands, registers_t *registers, link_t *return_values); /* extracts some bits from the command */ -uint32_t vm_getbits(command_t* command, int start, int count); +uint32_t vm_getbits(command_t* command, int32_t start, int32_t count); #ifdef TRACE /* for debugging: prints a link in readable form */ diff -r 0ee10bd2292a -r 6b1bfe8f5283 dvdnav.c --- a/dvdnav.c Sun May 11 00:53:28 2003 +0000 +++ b/dvdnav.c Sun May 11 01:13:40 2003 +0000 @@ -209,7 +209,7 @@ /* converts a dvd_time_t to PTS ticks */ static int64_t dvdnav_convert_time(dvd_time_t *time) { int64_t result; - int frames; + int64_t frames; result = (time->hour >> 4 ) * 10 * 60 * 60 * 90000; result += (time->hour & 0x0f) * 60 * 60 * 90000; @@ -236,14 +236,14 @@ * Most of the code in here is copied from xine's MPEG demuxer * so any bugs which are found in that should be corrected here also. */ -static int dvdnav_decode_packet(dvdnav_t *this, uint8_t *p, dsi_t *nav_dsi, pci_t *nav_pci) { - int bMpeg1 = 0; +static int32_t dvdnav_decode_packet(dvdnav_t *this, uint8_t *p, dsi_t *nav_dsi, pci_t *nav_pci) { + int32_t bMpeg1 = 0; uint32_t nHeaderLen; uint32_t nPacketLen; uint32_t nStreamID; if (p[3] == 0xBA) { /* program stream pack header */ - int nStuffingBytes; + int32_t nStuffingBytes; bMpeg1 = (p[4] & 0x40) == 0; @@ -274,7 +274,7 @@ if (nStreamID == 0xbf) { /* Private stream 2 */ #if 0 - int i; + int32_t i; fprintf(MSG_OUT, "libdvdnav: nav packet=%u\n",p-p_start-6); for(i=0;i<80;i++) fprintf(MSG_OUT, "%02x ",p[i-6]); @@ -301,9 +301,9 @@ /* DSI is used for most angle stuff. * PCI is used for only non-seemless angle stuff */ -static int dvdnav_get_vobu(dvdnav_t *this, dsi_t *nav_dsi, pci_t *nav_pci, dvdnav_vobu_t *vobu) { +static int32_t dvdnav_get_vobu(dvdnav_t *this, dsi_t *nav_dsi, pci_t *nav_pci, dvdnav_vobu_t *vobu) { uint32_t next; - int angle, num_angle; + int32_t angle, num_angle; vobu->vobu_start = nav_dsi->dsi_gi.nv_pck_lbn; /* Absolute offset from start of disk */ vobu->vobu_length = nav_dsi->dsi_gi.vobu_ea; /* Relative offset from vobu_start */ @@ -378,8 +378,8 @@ * The drawback is the additional memcopy. */ -dvdnav_status_t dvdnav_get_next_block(dvdnav_t *this, unsigned char *buf, - int *event, int *len) { +dvdnav_status_t dvdnav_get_next_block(dvdnav_t *this, uint8_t *buf, + int32_t *event, int32_t *len) { unsigned char *block; dvdnav_status_t status; @@ -393,10 +393,10 @@ return status; } -dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, unsigned char **buf, - int *event, int *len) { +dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, uint8_t **buf, + int32_t *event, int32_t *len) { dvd_state_t *state; - int result; + int32_t result; if(!this || !event || !len || !buf || !*buf) { printerr("Passed a NULL pointer."); @@ -440,12 +440,12 @@ fprintf(MSG_OUT, "libdvdnav: HOP_CHANNEL\n"); #endif if (this->position_next.hop_channel - this->position_current.hop_channel >= HOP_SEEK) { - int num_angles = 0, current; + int32_t num_angles = 0, current; /* we seeked -> check for multiple angles */ vm_get_angle_info(this->vm, ¤t, &num_angles); if (num_angles > 1) { - int result, block; + int32_t result, block; /* we have to skip the first VOBU when seeking in a multiangle feature, * because it might belong to the wrong angle */ block = this->position_next.cell_start + this->position_next.block; @@ -514,7 +514,7 @@ if((this->position_current.vts != this->position_next.vts) || (this->position_current.domain != this->position_next.domain)) { dvd_read_domain_t domain; - int vtsN; + int32_t vtsN; dvdnav_vts_change_event_t *vts_event = (dvdnav_vts_change_event_t *)*buf; if(this->file) { @@ -581,7 +581,7 @@ (this->position_current.cell_restart != this->position_next.cell_restart) || (this->position_current.cell_start != this->position_next.cell_start) ) { dvdnav_cell_change_event_t *cell_event = (dvdnav_cell_change_event_t *)*buf; - int first_cell_nr, last_cell_nr, i; + int32_t first_cell_nr, last_cell_nr, i; dvd_state_t *state = &this->vm->state; (*event) = DVDNAV_CELL_CHANGE; @@ -1041,8 +1041,8 @@ } /* Generally delegate angle information handling to VM */ -dvdnav_status_t dvdnav_angle_change(dvdnav_t *this, int angle) { - int num, current; +dvdnav_status_t dvdnav_angle_change(dvdnav_t *this, int32_t angle) { + int32_t num, current; if(!this) { printerr("Passed a NULL pointer."); @@ -1064,8 +1064,8 @@ return DVDNAV_STATUS_OK; } -dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *this, int *current_angle, - int *number_of_angles) { +dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *this, int32_t *current_angle, + int32_t *number_of_angles) { if(!this || !current_angle || !number_of_angles) { printerr("Passed a NULL pointer."); return DVDNAV_STATUS_ERR; diff -r 0ee10bd2292a -r 6b1bfe8f5283 dvdnav.h --- a/dvdnav.h Sun May 11 00:53:28 2003 +0000 +++ b/dvdnav.h Sun May 11 01:13:40 2003 +0000 @@ -60,7 +60,7 @@ typedef struct dvdnav_s dvdnav_t; /* Status as reported by most of libdvdnav's functions */ -typedef int dvdnav_status_t; +typedef int32_t dvdnav_status_t; /* * Unless otherwise stated, all functions return DVDNAV_STATUS_OK if @@ -132,7 +132,7 @@ * * This has _nothing_ to do with the region setting of the DVD drive. */ -dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int region_mask); +dvdnav_status_t dvdnav_set_region_mask(dvdnav_t *self, int32_t region_mask); /* * Returns the region mask (bit 0 set implies region 1, bit 1 set implies @@ -140,7 +140,7 @@ * * This has _nothing_ to do with the region setting of the DVD drive. */ -dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int *region_mask); +dvdnav_status_t dvdnav_get_region_mask(dvdnav_t *self, int32_t *region_mask); /* * Specify whether read-ahead caching should be used. You may not want this if your @@ -155,12 +155,12 @@ * If in addition you want to prevent memcpy's to improve performance, have a look * at dvdnav_get_next_cache_block(). */ -dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *self, int read_ahead_flag); +dvdnav_status_t dvdnav_set_readahead_flag(dvdnav_t *self, int32_t read_ahead_flag); /* * Query whether read-ahead caching/buffering will be used. */ -dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int *read_ahead_flag); +dvdnav_status_t dvdnav_get_readahead_flag(dvdnav_t *self, int32_t *read_ahead_flag); /* * Specify whether the positioning works PGC or PG based. @@ -169,12 +169,12 @@ * functions dvdnav_get_position() and dvdnav_sector_search(). See there. * Default is PG based positioning. */ -dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *self, int pgc_based_flag); +dvdnav_status_t dvdnav_set_PGC_positioning_flag(dvdnav_t *self, int32_t pgc_based_flag); /* * Query whether positioning is PG or PGC based. */ -dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *self, int *pgc_based_flag); +dvdnav_status_t dvdnav_get_PGC_positioning_flag(dvdnav_t *self, int32_t *pgc_based_flag); /********************************************************************* @@ -200,8 +200,8 @@ * * See the dvdnav_events.h header for information on the various events. */ -dvdnav_status_t dvdnav_get_next_block(dvdnav_t *self, unsigned char *buf, - int *event, int *len); +dvdnav_status_t dvdnav_get_next_block(dvdnav_t *self, uint8_t *buf, + int32_t *event, int32_t *len); /* * This basically does the same as dvdnav_get_next_block. The only difference is @@ -211,8 +211,8 @@ * Those pointers must _never_ be freed but instead returned to the library via * dvdnav_free_cache_block(). */ -dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *self, unsigned char **buf, - int *event, int *len); +dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *self, uint8_t **buf, + int32_t *event, int32_t *len); /* * All buffers which came from the internal cache (when dvdnav_get_next_cache_block() @@ -263,22 +263,22 @@ /* * Returns the number of titles on the disk. */ -dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int *titles); +dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *self, int32_t *titles); /* * Returns the number of parts within the given title. */ -dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *self, int title, int *parts); +dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *self, int32_t title, int32_t *parts); /* * Plays the specified title of the DVD from its beginning (that is: part 1). */ -dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int title); +dvdnav_status_t dvdnav_title_play(dvdnav_t *self, int32_t title); /* * Plays the specified title, starting from the specified part. */ -dvdnav_status_t dvdnav_part_play(dvdnav_t *self, int title, int part); +dvdnav_status_t dvdnav_part_play(dvdnav_t *self, int32_t title, int32_t part); /* * Play the specified amount of parts of the specified title of @@ -286,16 +286,16 @@ * * Currently unimplemented! */ -dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int title, - int part, int parts_to_play); +dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *self, int32_t title, + int32_t part, int32_t parts_to_play); /* * Play the specified title starting from the specified time. * * Currently unimplemented! */ -dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int title, - unsigned long int time); +dvdnav_status_t dvdnav_time_play(dvdnav_t *self, int32_t title, + uint64_t time); /* * Stop playing the current position and jump to the specified menu. @@ -309,8 +309,8 @@ * A title of 0 indicates, we are in a menu. In this case, part * is set to the current menu's ID. */ -dvdnav_status_t dvdnav_current_title_info(dvdnav_t *self, int *title, - int *part); +dvdnav_status_t dvdnav_current_title_info(dvdnav_t *self, int32_t *title, + int32_t *part); /* * Return the current position (in blocks) within the current @@ -320,8 +320,8 @@ * Use is discouraged! */ dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *self, - unsigned int *pos, - unsigned int *len); + uint32_t *pos, + uint32_t *len); /* * This function is only available for compatibility reasons. @@ -329,7 +329,7 @@ * Stop playing the current position and start playback of the current title * from the specified part. */ -dvdnav_status_t dvdnav_part_search(dvdnav_t *self, int part); +dvdnav_status_t dvdnav_part_search(dvdnav_t *self, int32_t part); /********************************************************************* @@ -351,7 +351,7 @@ * fcntl.h. */ dvdnav_status_t dvdnav_sector_search(dvdnav_t *self, - unsigned long int offset, int origin); + uint64_t offset, int32_t origin); /* * Stop playing the current position and start playback of the title @@ -360,7 +360,7 @@ * Currently unimplemented! */ dvdnav_status_t dvdnav_time_search(dvdnav_t *self, - unsigned long int time); + uint64_t time); /* * Stop playing current position and play the "GoUp"-program chain. @@ -394,8 +394,8 @@ * (see dvdnav_set_PGC_positioning_flag()), this will return the * relative position in and the length of the current program chain. */ -dvdnav_status_t dvdnav_get_position(dvdnav_t *self, unsigned int *pos, - unsigned int *len); +dvdnav_status_t dvdnav_get_position(dvdnav_t *self, uint32_t *pos, + uint32_t *len); /********************************************************************* @@ -416,7 +416,7 @@ * Get the currently highlighted button * number (1..36) or 0 if no button is highlighted. */ -dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *self, int *button); +dvdnav_status_t dvdnav_get_current_highlight(dvdnav_t *self, int32_t *button); /* * Returns the Presentation Control Information (PCI) structure associated @@ -458,12 +458,12 @@ /* * Highlight a specific button. */ -dvdnav_status_t dvdnav_button_select(dvdnav_t *self, pci_t *pci, int button); +dvdnav_status_t dvdnav_button_select(dvdnav_t *self, pci_t *pci, int32_t button); /* * Activate ("press") specified button. */ -dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *self, pci_t *pci, int button); +dvdnav_status_t dvdnav_button_select_and_activate(dvdnav_t *self, pci_t *pci, int32_t button); /* * Activate (press) a button and execute specified command. @@ -473,12 +473,12 @@ /* * Select button at specified video frame coordinates. */ -dvdnav_status_t dvdnav_mouse_select(dvdnav_t *self, pci_t *pci, int x, int y); +dvdnav_status_t dvdnav_mouse_select(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y); /* * Activate ("press") button at specified video frame coordinates. */ -dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *self, pci_t *pci, int x, int y); +dvdnav_status_t dvdnav_mouse_activate(dvdnav_t *self, pci_t *pci, int32_t x, int32_t y); /********************************************************************* @@ -595,13 +595,13 @@ * Sets the current angle. If you try to follow a non existant angle * the call fails. */ -dvdnav_status_t dvdnav_angle_change(dvdnav_t *self, int angle); +dvdnav_status_t dvdnav_angle_change(dvdnav_t *self, int32_t angle); /* * Returns the current angle and number of angles present. */ -dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *self, int *current_angle, - int *number_of_angles); +dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *self, int32_t *current_angle, + int32_t *number_of_angles); /********************************************************************* * domain queries * diff -r 0ee10bd2292a -r 6b1bfe8f5283 navigation.c --- a/navigation.c Sun May 11 00:53:28 2003 +0000 +++ b/navigation.c Sun May 11 01:13:40 2003 +0000 @@ -55,7 +55,7 @@ return DVDNAV_STATUS_OK; } -dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int *titles) { +dvdnav_status_t dvdnav_get_number_of_titles(dvdnav_t *this, int32_t *titles) { if(!this || !titles) { printerr("Passed a NULL pointer."); return DVDNAV_STATUS_ERR; @@ -72,7 +72,7 @@ return DVDNAV_STATUS_OK; } -dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *this, int title, int *parts) { +dvdnav_status_t dvdnav_get_number_of_parts(dvdnav_t *this, int32_t title, int32_t *parts) { if(!this || !parts) { printerr("Passed a NULL pointer."); return DVDNAV_STATUS_ERR; @@ -91,8 +91,8 @@ return DVDNAV_STATUS_OK; } -dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int *title, int *part) { - int retval; +dvdnav_status_t dvdnav_current_title_info(dvdnav_t *this, int32_t *title, int32_t *part) { + int32_t retval; if(!this || !title || !part) { printerr("Passed a NULL pointer."); @@ -130,7 +130,7 @@ return DVDNAV_STATUS_ERR; } -dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int title) { +dvdnav_status_t dvdnav_title_play(dvdnav_t *this, int32_t title) { if(!this) { printerr("Passed a NULL pointer."); return DVDNAV_STATUS_ERR; @@ -138,8 +138,8 @@ return dvdnav_part_play(this, title, 1); } -dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int title, int part) { - int retval; +dvdnav_status_t dvdnav_part_play(dvdnav_t *this, int32_t title, int32_t part) { + int32_t retval; if(!this) { printerr("Passed a NULL pointer."); @@ -176,16 +176,16 @@ return retval ? DVDNAV_STATUS_OK : DVDNAV_STATUS_ERR; } -dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int title, - int part, int parts_to_play) { +dvdnav_status_t dvdnav_part_play_auto_stop(dvdnav_t *this, int32_t title, + int32_t part, int32_t parts_to_play) { /* FIXME: Implement auto-stop */ if (dvdnav_part_play(this, title, part) == DVDNAV_STATUS_OK) printerr("Not implemented yet."); return DVDNAV_STATUS_ERR; } -dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int title, - unsigned long int time) { +dvdnav_status_t dvdnav_time_play(dvdnav_t *this, int32_t title, + uint64_t time) { if(!this) { printerr("Passed a NULL pointer."); return DVDNAV_STATUS_ERR; diff -r 0ee10bd2292a -r 6b1bfe8f5283 searching.c --- a/searching.c Sun May 11 00:53:28 2003 +0000 +++ b/searching.c Sun May 11 01:13:40 2003 +0000 @@ -35,7 +35,7 @@ /* Searching API calls */ dvdnav_status_t dvdnav_time_search(dvdnav_t *this, - unsigned long int time) { + uint64_t time) { /* FIXME: Time search the current PGC based on the xxx table */ return DVDNAV_STATUS_OK; } @@ -44,7 +44,7 @@ /* Return placed in vobu. */ /* Returns error status */ /* FIXME: Maybe need to handle seeking outside current cell. */ -static dvdnav_status_t dvdnav_scan_admap(dvdnav_t *this, int domain, uint32_t seekto_block, uint32_t *vobu) { +static dvdnav_status_t dvdnav_scan_admap(dvdnav_t *this, int32_t domain, uint32_t seekto_block, uint32_t *vobu) { vobu_admap_t *admap = NULL; #ifdef LOG_DEBUG @@ -71,7 +71,7 @@ if(admap) { uint32_t address = 0; uint32_t vobu_start, next_vobu; - int found = 0; + int32_t found = 0; /* Search through ADMAP for best sector */ vobu_start = SRI_END_OF_CELL; @@ -102,11 +102,11 @@ } dvdnav_status_t dvdnav_sector_search(dvdnav_t *this, - unsigned long int offset, int origin) { + uint64_t offset, int32_t origin) { uint32_t target = 0; uint32_t length = 0; uint32_t first_cell_nr, last_cell_nr, cell_nr; - int found; + int32_t found; cell_playback_t *cell; dvd_state_t *state; dvdnav_status_t result; @@ -220,8 +220,8 @@ return DVDNAV_STATUS_ERR; } -dvdnav_status_t dvdnav_part_search(dvdnav_t *this, int part) { - int title, old_part; +dvdnav_status_t dvdnav_part_search(dvdnav_t *this, int32_t part) { + int32_t title, old_part; if (dvdnav_current_title_info(this, &title, &old_part) == DVDNAV_STATUS_OK) return dvdnav_part_play(this, title, part); @@ -387,10 +387,10 @@ } } -dvdnav_status_t dvdnav_get_position(dvdnav_t *this, unsigned int *pos, - unsigned int *len) { +dvdnav_status_t dvdnav_get_position(dvdnav_t *this, uint32_t *pos, + uint32_t *len) { uint32_t cur_sector; - int cell_nr, first_cell_nr, last_cell_nr; + int32_t cell_nr, first_cell_nr, last_cell_nr; cell_playback_t *cell; dvd_state_t *state; @@ -455,8 +455,8 @@ } dvdnav_status_t dvdnav_get_position_in_title(dvdnav_t *this, - unsigned int *pos, - unsigned int *len) { + uint32_t *pos, + uint32_t *len) { uint32_t cur_sector; uint32_t first_cell_nr; uint32_t last_cell_nr;