[DVDnav-discuss] strange enum/domain code

Erik Hovland erik at hovland.org
Wed Nov 2 23:23:54 CET 2011


In dvdnav.c there is a few places where an assignment is made. Like at
or about line 563:
vts_event->new_domain = this->position_next.domain;

new_domain is of type dvd_read_domain_t and looks like this:
typedef enum {
  DVD_READ_INFO_FILE,        /**< VIDEO_TS.IFO  or VTS_XX_0.IFO (title) */
  DVD_READ_INFO_BACKUP_FILE, /**< VIDEO_TS.BUP  or VTS_XX_0.BUP (title) */
  DVD_READ_MENU_VOBS,        /**< VIDEO_TS.VOB  or VTS_XX_0.VOB (title) */
  DVD_READ_TITLE_VOBS        /**< VTS_XX_[1-9].VOB (title).  All files in
                                  the title set are opened and read as a
                                  single file. */
} dvd_read_domain_t;

While position_next.domain is of type domain_t and looks like this:
typedef enum {
  FP_DOMAIN   = 1,
  VTS_DOMAIN  = 2,
  VMGM_DOMAIN = 4,
  VTSM_DOMAIN = 8
} domain_t;

Note how the two enums only share two distinct values. Do you think
that other code elsewhere takes care to make sure that the enums
are in sync? I haven't found code for this.

I get the domain_t enum. But I have not yet figured out the
dvd_read_domain_t enum yet.

I am inclined to think that the real error here is that new_domain is
the wrong type.

Any opinions?

E

-- 
Erik Hovland
erik at hovland.org
http://hovland.org/


More information about the DVDnav-discuss mailing list