Commit 1ec56c76 authored by hpi1's avatar hpi1

Add const

parent 280e8fc7
Pipeline #20614 passed with stage
in 1 minute and 22 seconds
......@@ -511,7 +511,7 @@ void nav_free_title_list(NAV_TITLE_LIST **title_list)
*
*/
uint8_t nav_clip_lookup_aspect(NAV_CLIP *clip, int pid)
uint8_t nav_clip_lookup_aspect(const NAV_CLIP *clip, int pid)
{
CLPI_PROG *progs;
int ii, jj;
......@@ -884,7 +884,7 @@ NAV_CLIP* nav_mark_search(NAV_TITLE *title, unsigned mark, uint32_t *clip_pkt, u
return clip;
}
void nav_clip_packet_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *clip_pkt, uint32_t *clip_time)
void nav_clip_packet_search(const NAV_CLIP *clip, uint32_t pkt, uint32_t *clip_pkt, uint32_t *clip_time)
{
*clip_time = clip->in_time;
if (clip->cl != NULL) {
......@@ -958,7 +958,7 @@ NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt,
// Search to the timestamp obtained from nav_angle_change_search using
// nav_clip_time_search. Otherwise start at the start_pkt defined
// by the clip.
uint32_t nav_clip_angle_change_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *time)
uint32_t nav_clip_angle_change_search(const NAV_CLIP *clip, uint32_t pkt, uint32_t *time)
{
if (clip->cl == NULL) {
return pkt;
......@@ -1005,7 +1005,7 @@ NAV_CLIP* nav_time_search(NAV_TITLE *title, uint32_t tick, uint32_t *clip_pkt, u
// Search for random access point closest to the requested time
// Time is in 45khz ticks, between clip in_time and out_time.
void nav_clip_time_search(NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt)
void nav_clip_time_search(const NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt)
{
if (tick >= clip->out_time) {
*clip_pkt = clip->end_pkt;
......@@ -1034,7 +1034,7 @@ void nav_clip_time_search(NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uin
* Pointer to NAV_CLIP struct
* NULL - End of clip list
*/
NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip)
NAV_CLIP* nav_next_clip(NAV_TITLE *title, const NAV_CLIP *clip)
{
if (clip == NULL) {
return &title->clip_list.clip[0];
......@@ -1079,7 +1079,7 @@ void nav_set_angle(NAV_TITLE *title, unsigned angle)
_extrapolate_title(title);
}
char *nav_clip_textst_font(NAV_CLIP *clip, int index)
char *nav_clip_textst_font(const NAV_CLIP *clip, int index)
{
char *file;
......
......@@ -151,7 +151,7 @@ BD_PRIVATE void nav_free_title_list(NAV_TITLE_LIST **title_list);
BD_PRIVATE NAV_TITLE* nav_title_open(struct bd_disc *disc, const char *playlist, unsigned angle) BD_ATTR_MALLOC;
BD_PRIVATE void nav_title_close(NAV_TITLE **title);
BD_PRIVATE NAV_CLIP* nav_next_clip(NAV_TITLE *title, NAV_CLIP *clip);
BD_PRIVATE NAV_CLIP* nav_next_clip(NAV_TITLE *title, const NAV_CLIP *clip);
BD_PRIVATE uint32_t nav_chapter_get_current(NAV_TITLE *title, uint32_t title_pkt);
BD_PRIVATE void nav_set_angle(NAV_TITLE *title, unsigned angle);
......@@ -163,11 +163,11 @@ BD_PRIVATE NAV_CLIP* nav_mark_search(NAV_TITLE *title, unsigned mark, uint32_t *
/* clip ops */
BD_PRIVATE uint32_t nav_clip_angle_change_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *time);
BD_PRIVATE void nav_clip_time_search(NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt);
BD_PRIVATE void nav_clip_packet_search(NAV_CLIP *clip, uint32_t pkt, uint32_t *clip_pkt, uint32_t *clip_time);
BD_PRIVATE uint32_t nav_clip_angle_change_search(const NAV_CLIP *clip, uint32_t pkt, uint32_t *time);
BD_PRIVATE void nav_clip_time_search(const NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uint32_t *out_pkt);
BD_PRIVATE void nav_clip_packet_search(const NAV_CLIP *clip, uint32_t pkt, uint32_t *clip_pkt, uint32_t *clip_time);
BD_PRIVATE char *nav_clip_textst_font(NAV_CLIP *clip, int index);
BD_PRIVATE uint8_t nav_clip_lookup_aspect(NAV_CLIP *clip, int pid);
BD_PRIVATE char *nav_clip_textst_font(const NAV_CLIP *clip, int index);
BD_PRIVATE uint8_t nav_clip_lookup_aspect(const NAV_CLIP *clip, int pid);
#endif // _NAVIGATION_H_
......@@ -67,7 +67,7 @@ typedef enum {
typedef struct {
/* current clip */
NAV_CLIP *clip;
const NAV_CLIP *clip;
BD_FILE_H *fp;
uint64_t clip_size;
uint64_t clip_block_pos;
......@@ -92,7 +92,7 @@ typedef struct {
} BD_STREAM;
typedef struct {
NAV_CLIP *clip;
const NAV_CLIP *clip;
size_t clip_size;
uint8_t *buf;
} BD_PRELOAD;
......@@ -241,7 +241,7 @@ static void _update_time_psr(BLURAY *bd, uint32_t time)
static uint32_t _update_time_psr_from_stream(BLURAY *bd)
{
/* update PSR_TIME from stream. Not real presentation time (except when seeking), but near enough. */
NAV_CLIP *clip = bd->st0.clip;
const NAV_CLIP *clip = bd->st0.clip;
if (bd->title && clip) {
......@@ -311,7 +311,7 @@ static void _update_stream_psr_by_lang(BD_REGISTERS *regs,
0x80000fff);
}
static void _update_clip_psrs(BLURAY *bd, NAV_CLIP *clip)
static void _update_clip_psrs(BLURAY *bd, const NAV_CLIP *clip)
{
MPLS_STN *stn = &clip->title->pl->play_item[clip->ref].stn;
uint32_t audio_lang = 0;
......@@ -358,7 +358,7 @@ static void _update_clip_psrs(BLURAY *bd, NAV_CLIP *clip)
static void _update_playlist_psrs(BLURAY *bd)
{
NAV_CLIP *clip = bd->st0.clip;
const NAV_CLIP *clip = bd->st0.clip;
bd_psr_write(bd->regs, PSR_PLAYLIST, atoi(bd->title->name));
bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1);
......@@ -497,7 +497,7 @@ static void _update_textst_timer(BLURAY *bd)
/* next event in this clip ? */
if (cmds.wakeup_time >= bd->st0.clip->in_time && cmds.wakeup_time < bd->st0.clip->out_time) {
/* find event position in main path clip */
NAV_CLIP *clip = bd->st0.clip;
const NAV_CLIP *clip = bd->st0.clip;
if (clip->cl) {
uint32_t spn;
nav_clip_time_search(clip, cmds.wakeup_time, &spn, NULL);
......@@ -821,7 +821,7 @@ static int _preload_m2ts(BLURAY *bd, BD_PRELOAD *p)
}
static int64_t _seek_stream(BLURAY *bd, BD_STREAM *st,
NAV_CLIP *clip, uint32_t clip_pkt)
const NAV_CLIP *clip, uint32_t clip_pkt)
{
if (!clip)
return -1;
......@@ -1612,7 +1612,7 @@ static void _playmark_reached(BLURAY *bd)
*/
static void _seek_internal(BLURAY *bd,
NAV_CLIP *clip, uint32_t title_pkt, uint32_t clip_pkt)
const NAV_CLIP *clip, uint32_t title_pkt, uint32_t clip_pkt)
{
if (_seek_stream(bd, &bd->st0, clip, clip_pkt) >= 0) {
uint32_t media_time;
......@@ -1660,7 +1660,7 @@ static void _change_angle(BLURAY *bd)
int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
{
uint32_t clip_pkt, out_pkt;
NAV_CLIP *clip;
const NAV_CLIP *clip;
if (tick >> 33) {
BD_DEBUG(DBG_BLURAY | DBG_CRIT, "bd_seek_time(%" PRIu64 ") failed: invalid timestamp\n", tick);
......@@ -1693,7 +1693,7 @@ int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
uint64_t bd_tell_time(BLURAY *bd)
{
uint32_t clip_pkt = 0, out_pkt = 0, out_time = 0;
NAV_CLIP *clip;
const NAV_CLIP *clip;
if (!bd) {
return 0;
......@@ -1716,7 +1716,7 @@ uint64_t bd_tell_time(BLURAY *bd)
int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter)
{
uint32_t clip_pkt, out_pkt;
NAV_CLIP *clip;
const NAV_CLIP *clip;
bd_mutex_lock(&bd->mutex);
......@@ -1777,7 +1777,7 @@ uint32_t bd_get_current_chapter(BLURAY *bd)
int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
{
uint32_t clip_pkt, out_pkt;
NAV_CLIP *clip;
const NAV_CLIP *clip;
bd_mutex_lock(&bd->mutex);
......@@ -1804,7 +1804,7 @@ int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
{
uint32_t clip_pkt, out_pkt;
NAV_CLIP *clip;
const NAV_CLIP *clip;
bd_mutex_lock(&bd->mutex);
......@@ -1830,7 +1830,7 @@ int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
int64_t bd_seek(BLURAY *bd, uint64_t pos)
{
uint32_t pkt, clip_pkt, out_pkt, out_time;
NAV_CLIP *clip;
const NAV_CLIP *clip;
bd_mutex_lock(&bd->mutex);
......@@ -2614,7 +2614,7 @@ int bd_get_main_title(BLURAY *bd)
return bd->title_list->main_title_idx;
}
static int _copy_streams(NAV_CLIP *clip, BLURAY_STREAM_INFO **pstreams, MPLS_STREAM *si, int count)
static int _copy_streams(const NAV_CLIP *clip, BLURAY_STREAM_INFO **pstreams, MPLS_STREAM *si, int count)
{
BLURAY_STREAM_INFO *streams;
int ii;
......@@ -2695,7 +2695,7 @@ static BLURAY_TITLE_INFO* _fill_title_info(NAV_TITLE* title, uint32_t title_idx,
for (ii = 0; ii < title_info->clip_count; ii++) {
MPLS_PI *pi = &title->pl->play_item[ii];
BLURAY_CLIP_INFO *ci = &title_info->clips[ii];
NAV_CLIP *nc = &title->clip_list.clip[ii];
const NAV_CLIP *nc = &title->clip_list.clip[ii];
memcpy(ci->clip_id, pi->clip->clip_id, sizeof(ci->clip_id));
ci->pkt_count = nc->end_pkt - nc->start_pkt;
......@@ -3863,7 +3863,7 @@ int bd_get_meta_file(BLURAY *bd, const char *name, void **data, int64_t *size)
struct clpi_cl *bd_get_clpi(BLURAY *bd, unsigned clip_ref)
{
if (bd->title && clip_ref < bd->title->clip_list.count) {
NAV_CLIP *clip = &bd->title->clip_list.clip[clip_ref];
const NAV_CLIP *clip = &bd->title->clip_list.clip[clip_ref];
return clpi_copy(clip->cl);
}
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment