[DVDnav-discuss] Using libdvdnav on ARM Based NAS

John boilerjt at gmail.com
Wed Dec 10 03:02:11 CET 2008


Nico,

I have figured it out.  It was a memory alignment issue, but not one I
expected.  In ifo_types.h, structure audio_attr_t, when checking a sizeof on
the structure on my PC, it returned a size of 8, which I expected.  When I
read the sizeof this structure on my ARM NAS, it returned a size of 11.
This would account for the zero check fail errors because the 3 bytes of
extra padding was added to the each instantiated structure. Here is the
structure from 4.1.3:

typedef struct {
  unsigned char audio_format           : 3;
  unsigned char multichannel_extension : 1;
  unsigned char lang_type              : 2;
  unsigned char application_mode       : 2;

  unsigned char quantization           : 2;
  unsigned char sample_frequency       : 2;
  unsigned char unknown1               : 1;
  unsigned char channels               : 3;
  uint16_t lang_code;
  uint8_t  lang_extension;
  uint8_t  code_extension;
  uint8_t unknown3;
  union {
    struct ATTRIBUTE_PACKED {
      unsigned char unknown4           : 1;
      unsigned char channel_assignment : 3;
      unsigned char version            : 2;
      unsigned char mc_intro           : 1; /* probably 0: true, 1:false */
      unsigned char mode               : 1; /* Karaoke mode 0: solo 1: duet
*/
    } karaoke;
    struct ATTRIBUTE_PACKED {
      unsigned char unknown5           : 4;
      unsigned char dolby_encoded      : 1; /* suitable for surround
decoding */
      unsigned char unknown6           : 3;
    } surround;
  } app_info;
} ATTRIBUTE_PACKED audio_attr_t;

I saw that there was no ATTRIBUTE__PACKED on the app_info union and when I
added this to line 123, the size of the structure was read as 8 on my NAS.
I simply changed " } app_info;" to "} ATTRIBUTE_PACKED app_info;"  I then
recompiled and ran the menus examples in libdvdnav and I saw no zero check
errors.  Just for completeless, I read the size of the structure on my PC
with the change and it remained as 8, so it seems to have no effect when
running on x86.

Best Regards,
John


On Tue, Dec 9, 2008 at 2:52 AM, Nico Sabbi <Nicola.Sabbi at poste.it> wrote:

> On Tuesday 09 December 2008 05:03:38 John wrote:
> > I think I am beginning to understand what is going on, but not why
> > it happens.  For reference, here is the output I get from the menus
> > example from libdvdnav 4.1.3 from my DNS-323 NAS when getting the
> > information from a DVD:
> >
>
> > *All but one of these Zero check errors occur in the
> > ifoRead_VTS_ATTRIBUTES function in dvd_reader.c.  From what I can
> > gather, this function extracts the audio information from the DVD.
> > In looking at some of the data that is shown in the output above
> > where there should have been zeros read, I see numerous references
> > to 0x656e and 0x6672 which are the ascii values for "en" and "fr".
> > This DVD does have English and French audio soundtracks and this
> > would be valid information for other properties in the
> > vts_attributes_t structure that was filled when the DVD was read.
> > It appears to me that the base memory address when the VTS
> > attributes were read from the DVD was incorrect.  I do not see
> > these errors when using the same version on my Ubuntu Hardy setup
> > and I am having difficulty finding where this incorrect base memory
> > address could be have occurred on the NAS (armv5tejl).  Any ideas?
> >
>
> try to backtrack in svn to before I removed the _ENDIAN macros in
> dvdread. I may have made some mistake, although I consider the
> code correct
> _______________________________________________
> DVDnav-discuss mailing list
> DVDnav-discuss at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/dvdnav-discuss
>



More information about the DVDnav-discuss mailing list