Commit 5fdc99c4 authored by hpi1's avatar hpi1

Moved seamless angle change code from seeking functions to _change_angle()

parent c5822ca9
......@@ -540,21 +540,26 @@ static int64_t _seek_internal(BLURAY *bd, BD_STREAM *st,
return bd->s_pos;
}
int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
static void _change_angle(BLURAY *bd)
{
uint32_t clip_pkt, out_pkt;
NAV_CLIP *clip;
if (bd->seamless_angle_change) {
bd->st0.clip = nav_set_angle(bd->title, bd->st0.clip, bd->request_angle);
bd->seamless_angle_change = 0;
bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1);
}
}
int64_t bd_seek_time(BLURAY *bd, uint64_t tick)
{
uint32_t clip_pkt, out_pkt;
NAV_CLIP *clip;
tick /= 2;
if (tick < bd->title->duration) {
_change_angle(bd);
// Find the closest access unit to the requested position
clip = nav_time_search(bd->title, tick, &clip_pkt, &out_pkt);
......@@ -582,6 +587,8 @@ int64_t bd_seek_chapter(BLURAY *bd, unsigned chapter)
if (chapter < bd->title->chap_list.count) {
_change_angle(bd);
// Find the closest access unit to the requested position
clip = nav_chapter_search(bd->title, chapter, &clip_pkt, &out_pkt);
......@@ -616,6 +623,8 @@ int64_t bd_seek_mark(BLURAY *bd, unsigned mark)
if (mark < bd->title->mark_list.count) {
_change_angle(bd);
// Find the closest access unit to the requested position
clip = nav_mark_search(bd->title, mark, &clip_pkt, &out_pkt);
......@@ -630,14 +639,11 @@ int64_t bd_seek(BLURAY *bd, uint64_t pos)
uint32_t pkt, clip_pkt, out_pkt, out_time;
NAV_CLIP *clip;
if (bd->seamless_angle_change) {
bd->st0.clip = nav_set_angle(bd->title, bd->st0.clip, bd->request_angle);
bd->seamless_angle_change = 0;
bd_psr_write(bd->regs, PSR_ANGLE_NUMBER, bd->title->angle + 1);
}
if (pos < (uint64_t)bd->title->packets * 192) {
pkt = pos / 192;
_change_angle(bd);
// Find the closest access unit to the requested position
clip = nav_packet_search(bd->title, pkt, &clip_pkt, &out_pkt, &out_time);
......
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