Commit 7a28187c authored by Petri Hintukainen's avatar Petri Hintukainen

Remove duplicate fields from NAV_CLIP.

All fields were not properly updated after angle change.
parent 674cb39c
......@@ -443,9 +443,9 @@ static void _fill_clip(NAV_TITLE *title,
mpls_clip[clip->angle].stc_id);
clip->in_time = in_time;
clip->out_time = out_time;
clip->pos = *pos;
clip->title_pkt = *pos;
*pos += clip->end_pkt - clip->start_pkt;
clip->start_time = *time;
clip->title_time = *time;
*time += clip->out_time - clip->in_time;
}
......@@ -569,12 +569,12 @@ NAV_CLIP* nav_chapter_search(NAV_TITLE *title, unsigned chapter, uint32_t *clip_
if (chapter > title->chap_list.count) {
clip = &title->clip_list.clip[0];
*clip_pkt = clip->start_pkt;
*out_pkt = clip->pos;
*out_pkt = clip->title_pkt;
return clip;
}
clip = &title->clip_list.clip[title->chap_list.mark[chapter].clip_ref];
*clip_pkt = title->chap_list.mark[chapter].clip_pkt;
*out_pkt = clip->pos + *clip_pkt - clip->start_pkt;
*out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt;
return clip;
}
......@@ -620,12 +620,12 @@ NAV_CLIP* nav_mark_search(NAV_TITLE *title, unsigned mark, uint32_t *clip_pkt, u
if (mark > title->mark_list.count) {
clip = &title->clip_list.clip[0];
*clip_pkt = clip->start_pkt;
*out_pkt = clip->pos;
*out_pkt = clip->title_pkt;
return clip;
}
clip = &title->clip_list.clip[title->mark_list.mark[mark].clip_ref];
*clip_pkt = title->mark_list.mark[mark].clip_pkt;
*out_pkt = clip->pos + *clip_pkt - clip->start_pkt;
*out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt;
return clip;
}
......@@ -666,7 +666,7 @@ NAV_CLIP* nav_packet_search(NAV_TITLE *title, uint32_t pkt, uint32_t *clip_pkt,
*out_time = 0;
else
*out_time -= clip->in_time;
*out_pkt = clip->pos + *clip_pkt - clip->start_pkt;
*out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt;
return clip;
}
......@@ -740,7 +740,7 @@ NAV_CLIP* nav_time_search(NAV_TITLE *title, uint32_t tick, uint32_t *clip_pkt, u
*clip_pkt = clip->start_pkt;
}
}
*out_pkt = clip->pos + *clip_pkt - clip->start_pkt;
*out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt;
return clip;
}
......@@ -758,7 +758,7 @@ void nav_clip_time_search(NAV_CLIP *clip, uint32_t tick, uint32_t *clip_pkt, uin
*clip_pkt = clip->start_pkt;
}
}
*out_pkt = clip->pos + *clip_pkt - clip->start_pkt;
*out_pkt = clip->title_pkt + *clip_pkt - clip->start_pkt;
}
/*
......
......@@ -66,13 +66,11 @@ struct nav_clip_s
char name[11];
uint32_t clip_id;
unsigned ref;
uint32_t pos;
uint32_t start_pkt;
uint32_t end_pkt;
uint8_t connection;
uint8_t angle;
uint32_t start_time;
uint32_t duration;
uint32_t in_time;
......
......@@ -1549,7 +1549,7 @@ uint64_t bd_tell_time(BLURAY *bd)
if (bd && bd->title) {
clip = nav_packet_search(bd->title, SPN(bd->s_pos), &clip_pkt, &out_pkt, &out_time);
if (clip) {
out_time += clip->start_time;
out_time += clip->title_time;
}
}
......@@ -1633,7 +1633,7 @@ int64_t bd_seek_playitem(BLURAY *bd, unsigned clip_ref)
clip = &bd->title->clip_list.clip[clip_ref];
clip_pkt = clip->start_pkt;
out_pkt = clip->pos;
out_pkt = clip->title_pkt;
_seek_internal(bd, clip, out_pkt, clip_pkt);
......@@ -1768,7 +1768,7 @@ static int _bd_read(BLURAY *bd, unsigned char *buf, int len)
if (!_open_m2ts(bd, st)) {
return -1;
}
bd->s_pos = st->clip->pos * 192;
bd->s_pos = st->clip->title_pkt * 192;
} else {
_change_angle(bd);
_clip_seek_time(bd, bd->angle_change_time);
......@@ -2420,7 +2420,7 @@ static BLURAY_TITLE_INFO* _fill_title_info(NAV_TITLE* title, uint32_t title_idx,
NAV_CLIP *nc = &title->clip_list.clip[ii];
ci->pkt_count = nc->end_pkt - nc->start_pkt;
ci->start_time = (uint64_t)nc->start_time * 2;
ci->start_time = (uint64_t)nc->title_time * 2;
ci->in_time = (uint64_t)pi->in_time * 2;
ci->out_time = (uint64_t)pi->out_time * 2;
ci->still_mode = pi->still_mode;
......
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