From a6e8a20439aa17da2e1436354a28b8ed9d7f4c99 Mon Sep 17 00:00:00 2001
From: Richard <peper03@yahoo.com>
Date: Tue, 19 Feb 2013 19:33:36 +0100
Subject: [PATCH 1/2] Sync libdvdnav up to R1251.
* Fix failed assertion when there's no menu.
* Make sure we get nav packets for all cells in multi angle features
* Fix strict aliasing warnings.
---
mythtv/libs/libmythdvdnav/dvdnav/dvdnav.c | 15 +++++++++------
mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h | 2 +-
mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h | 8 ++++++++
mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c | 3 ++-
4 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.c b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.c
index 6b005a9..4fe270b 100644
a
|
b
|
static int32_t dvdnav_get_vobu(dvdnav_t *this, dsi_t *nav_dsi, pci_t *nav_pci, d |
336 | 336 | dvdnav_angle_change(this, 1); |
337 | 337 | } |
338 | 338 | #endif |
339 | | |
340 | | if(num_angle != 0) { |
| 339 | /* only use ILVU information if we are at the last vobunit in ILVU */ |
| 340 | /* otherwise we will miss nav packets from vobunits inbetween */ |
| 341 | if(num_angle != 0 && (nav_dsi->sml_pbi.category & DSI_ILVU_MASK) == (DSI_ILVU_BLOCK | DSI_ILVU_LAST)) { |
341 | 342 | |
342 | 343 | if((next = nav_pci->nsml_agli.nsml_agl_dsta[angle-1]) != 0) { |
343 | 344 | if((next & 0x3fffffff) != 0) { |
… |
… |
user_ops_t dvdnav_get_restrictions(dvdnav_t* this) { |
1203 | 1204 | union { |
1204 | 1205 | user_ops_t ops_struct; |
1205 | 1206 | uint32_t ops_int; |
1206 | | } ops; |
| 1207 | } ops, tmp; |
1207 | 1208 | |
1208 | 1209 | ops.ops_int = 0; |
1209 | 1210 | |
… |
… |
user_ops_t dvdnav_get_restrictions(dvdnav_t* this) { |
1213 | 1214 | } |
1214 | 1215 | |
1215 | 1216 | pthread_mutex_lock(&this->vm_lock); |
1216 | | ops.ops_int |= *(uint32_t*)&this->pci.pci_gi.vobu_uop_ctl; |
| 1217 | ops.ops_struct = this->pci.pci_gi.vobu_uop_ctl; |
1217 | 1218 | |
1218 | | if(this->vm && this->vm->state.pgc) |
1219 | | ops.ops_int |= *(uint32_t*)&this->vm->state.pgc->prohibited_ops; |
| 1219 | if(this->vm && this->vm->state.pgc) { |
| 1220 | tmp.ops_struct = this->vm->state.pgc->prohibited_ops; |
| 1221 | ops.ops_int |= tmp.ops_int; |
| 1222 | } |
1220 | 1223 | pthread_mutex_unlock(&this->vm_lock); |
1221 | 1224 | |
1222 | 1225 | return ops.ops_struct; |
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav.h
index bcc1d48..04fe99a 100644
a
|
b
|
|
29 | 29 | #define MP_DVDNAV 1 |
30 | 30 | |
31 | 31 | // Change this only when syncing to mplayer dvdnav trunk |
32 | | #define DVDNAV_SVN_REV "svnR1239" |
| 32 | #define DVDNAV_SVN_REV "svnR1251" |
33 | 33 | |
34 | 34 | #ifdef __cplusplus |
35 | 35 | extern "C" { |
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h b/mythtv/libs/libmythdvdnav/dvdnav/dvdnav_internal.h
index 2f4ebfa..029b853 100644
a
|
b
|
static inline int _private_gettimeofday( struct timeval *tv, void *tz ) |
76 | 76 | #define DVD_VIDEO_LB_LEN 2048 |
77 | 77 | #endif |
78 | 78 | |
| 79 | typedef enum { |
| 80 | DSI_ILVU_PRE = 1 << 15, /* set during the last 3 VOBU preceeding an interleaved block. */ |
| 81 | DSI_ILVU_BLOCK = 1 << 14, /* set for all VOBU in an interleaved block */ |
| 82 | 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 */ |
| 83 | 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 */ |
| 84 | DSI_ILVU_MASK = 0xf000 |
| 85 | } DSI_ILVU; |
| 86 | |
79 | 87 | typedef struct read_cache_s read_cache_t; |
80 | 88 | |
81 | 89 | /* |
diff --git a/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c b/mythtv/libs/libmythdvdnav/dvdnav/vm/vm.c
index 4c94ede..f531ade 100644
a
|
b
|
static int set_PGCN(vm_t *vm, int pgcN) { |
1794 | 1794 | pgcit_t *pgcit; |
1795 | 1795 | |
1796 | 1796 | pgcit = get_PGCIT(vm); |
1797 | | assert(pgcit != NULL); /* ?? Make this return -1 instead */ |
| 1797 | if (pgcit == NULL) |
| 1798 | return 0; |
1798 | 1799 | |
1799 | 1800 | if(pgcN < 1 || pgcN > pgcit->nr_of_pgci_srp) { |
1800 | 1801 | #ifdef TRACE |