On Tue, 1 Nov 2011 02:16:41 +0100, Joakim Plate wrote:
> ILVU flag and Unit_End flag from
> http://dvdnav.mplayerhq.hu/dvdinfo/dsi_pkt.html#ilvu
>
> Suppose that should be added to libdvdread in that case.
Here's and updated patch with the flags named. The logic is starting to get
back to me now too :)
There can be multiple vob units for a single angle in a ILVU block. So
dvdnav_get_vobu can't jump the gun and skip to the next ILVU before we have
seen the last vobunit of that block.
/Joakim
From 8fe9a911cc3ae84647bf229496ebf6da20474e16 Mon Sep 17 00:00:00 2001
From: Joakim Plate <[email protected]>
Date: Tue, 1 Nov 2011 22:08:38 +0100
Subject: [PATCH] Make sure we get nav packets for all cells in multi angle
features
Currently libdvdnav uses the ILVU information to specify where a vobunit
ends if a feature is multiangled. However since one ILVU can contain
multiple vobunits, this means that libdvdnav never generates NAV events nor
updates highlight information for anything but the first vobunit in the
ILVU. It also causes issues for any player relying on timestamps in nav
packets to flatten the mpeg timestamps.
http://dvdnav.mplayerhq.hu/dvdinfo/dsi_pkt.html#ilvu
---
src/dvdnav.c | 5 +++--
src/dvdnav_internal.h | 8 ++++++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/dvdnav.c b/src/dvdnav.c
index 4d0b4f1..da037a9 100644
--- a/src/dvdnav.c
+++ b/src/dvdnav.c
@@ -336,8 +336,9 @@ static int32_t dvdnav_get_vobu(dvdnav_t *this, dsi_t *nav_dsi, pci_t *nav_pci, d
dvdnav_angle_change(this, 1);
}
#endif
-
- if(num_angle != 0) {
+ /* only use ILVU information if we are at the last vobunit in ILVU */
+ /* otherwise we will miss nav packets from vobunits inbetween */
+ if(num_angle != 0 && (nav_dsi->sml_pbi.category & DSI_ILVU_MASK) == (DSI_ILVU_BLOCK | DSI_ILVU_LAST)) {
if((next = nav_pci->nsml_agli.nsml_agl_dsta[angle-1]) != 0) {
if((next & 0x3fffffff) != 0) {
diff --git a/src/dvdnav_internal.h b/src/dvdnav_internal.h
index e78470d..089ab14 100644
--- a/src/dvdnav_internal.h
+++ b/src/dvdnav_internal.h
@@ -76,6 +76,14 @@ static inline int _private_gettimeofday( struct timeval *tv, void *tz )
#define DVD_VIDEO_LB_LEN 2048
#endif
+typedef enum {
+ DSI_ILVU_PRE = 1 << 15, /* set during the last 3 VOBU preceeding an interleaved block. */
+ DSI_ILVU_BLOCK = 1 << 14, /* set for all VOBU in an interleaved block */
+ DSI_ILVU_FIRST = 1 << 13, /* set for the first VOBU for a given angle or scene within a ILVU, or the first VOBU in the preparation (PREU) sequence */
+ DSI_ILVU_LAST = 1 << 12, /* set for the last VOBU for a given angle or scene within a ILVU, or the last VOBU in the preparation (PREU) sequence */
+ DSI_ILVU_MASK = 0xf000
+} DSI_ILVU;
+
typedef struct read_cache_s read_cache_t;
/*
--
1.7.7
_______________________________________________
DVDnav-discuss mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss