# HG changeset patch # User mrouthier # Date 1111177634 0 # Node ID 7708d2fc17456cafa16767fe6e00ad9c055e6bd1 # Parent 8ad83ff183be0eebe9f406f11d7add24df867285 added dvdnav_get_restrictions() diff -r 8ad83ff183be -r 7708d2fc1745 dvdnav.c --- a/dvdnav.c Wed Feb 09 17:07:27 2005 +0000 +++ b/dvdnav.c Fri Mar 18 20:27:14 2005 +0000 @@ -1086,3 +1086,18 @@ return this->position_next.still; } +user_ops_t dvdnav_get_restrictions(dvdnav_t* this) { + /* + * user_ops_t is a structure of 32 bits. We want to compute + * the union of two of those bitfields so to make this quicker + * than performing 32 ORs, we will access them as 32bits words. + */ + uint32_t ops=0; + + ops|=*(uint32_t*)&this->pci.pci_gi.vobu_uop_ctl; + + if(this->vm && this->vm->state.pgc) + ops|=*(uint32_t*)&this->vm->state.pgc->prohibited_ops; + + return *(user_ops_t*)&ops; +} diff -r 8ad83ff183be -r 7708d2fc1745 dvdnav.h --- a/dvdnav.h Wed Feb 09 17:07:27 2005 +0000 +++ b/dvdnav.h Fri Mar 18 20:27:14 2005 +0000 @@ -573,6 +573,12 @@ */ int8_t dvdnav_get_active_spu_stream(dvdnav_t *self); +/* + * Get the set of user operations that are currently prohibited. + * There are potentially new restrictions right after + * DVDNAV_CHANNEL_HOP and DVDNAV_NAV_PACKET. + */ +user_ops_t dvdnav_get_restrictions(dvdnav_t *self); /********************************************************************* * multiple angles *