[libbluray-devel] Remove duplicate fields from NAV_CLIP.
hpi1
git at videolan.org
Thu Jul 17 11:56:48 CEST 2014
libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Thu Jul 17 12:55:42 2014 +0300| [7a28187c1e4a8b26207def0bf08a74671e783003] | committer: hpi1
Remove duplicate fields from NAV_CLIP.
All fields were not properly updated after angle change.
> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=7a28187c1e4a8b26207def0bf08a74671e783003
---
src/libbluray/bdnav/navigation.c | 18 +++++++++---------
src/libbluray/bdnav/navigation.h | 2 --
src/libbluray/bluray.c | 8 ++++----
3 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/src/libbluray/bdnav/navigation.c b/src/libbluray/bdnav/navigation.c
index 9612242..f6371c2 100644
--- a/src/libbluray/bdnav/navigation.c
+++ b/src/libbluray/bdnav/navigation.c
@@ -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;
}
/*
diff --git a/src/libbluray/bdnav/navigation.h b/src/libbluray/bdnav/navigation.h
index 9cc1032..1eef761 100644
--- a/src/libbluray/bdnav/navigation.h
+++ b/src/libbluray/bdnav/navigation.h
@@ -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;
diff --git a/src/libbluray/bluray.c b/src/libbluray/bluray.c
index c2f4ffa..92481f1 100644
--- a/src/libbluray/bluray.c
+++ b/src/libbluray/bluray.c
@@ -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;
More information about the libbluray-devel
mailing list