libcdio-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libcdio-devel] Re: here's a patch that changes nothing...


From: Robert William Fuller
Subject: [Libcdio-devel] Re: here's a patch that changes nothing...
Date: Sat, 08 Mar 2008 22:55:56 -0500
User-agent: Thunderbird 2.0.0.6 (X11/20071013)

Robert William Fuller wrote:
Robert William Fuller wrote:
Robert William Fuller wrote:
This is preliminary work for adding support for audio track pregaps in NRG images. It does not change existing behavior, but it does add necessary fields to the daox and daoi structures. Let me know what you think. I'm assuming I should hold on to these until after the freeze?

Scratch that. I just realized I can delete code from nrg.c! Another patch will follow.

Sheesh, why make common structures if you don't delete code? Ok, so here's the revised version:

Aw crap. I'll never get this right. Here's the same patch with the "Only in" removed:


diff -cr libcdio-0.80-clean/lib/driver/image/nrg.c 
libcdio-0.80/lib/driver/image/nrg.c
*** libcdio-0.80-clean/lib/driver/image/nrg.c   Mon Mar  3 07:04:34 2008
--- libcdio-0.80/lib/driver/image/nrg.c Sat Mar  8 22:47:13 2008
***************
*** 371,394 ****
        case DAOX_ID: /* "DAOX" */ 
        case DAOI_ID: /* "DAOI" */
        {
          track_format_t track_format;
          int disc_mode;
  
          /* We include an extra 0 byte so these can be used as C strings.*/
          p_env->psz_mcn    = calloc(1, CDIO_MCN_SIZE+1);
  
          if (DAOX_ID == opcode) {
!           _daox_array_t *_entries = (void *) chunk->data;
!           disc_mode    = _entries->_unknown[1];
!           p_env->dtyp  = _entries->_unknown[19];
!           memcpy(p_env->psz_mcn, &(_entries->psz_mcn), CDIO_MCN_SIZE);
!           p_env->psz_mcn[CDIO_MCN_SIZE] = '\0';
          } else {
!           _daoi_array_t *_entries = (void *) chunk->data;
!           disc_mode    = _entries->_unknown[1];
!           p_env->dtyp  = _entries->_unknown[19];
!           memcpy(p_env->psz_mcn, &(_entries->psz_mcn), CDIO_MCN_SIZE);
!           p_env->psz_mcn[CDIO_MCN_SIZE] = '\0';
          }
  
          p_env->is_dao = true;
--- 371,393 ----
        case DAOX_ID: /* "DAOX" */ 
        case DAOI_ID: /* "DAOI" */
        {
+           _dao_common_t *_dao_common = (void *) chunk->data;
          track_format_t track_format;
          int disc_mode;
  
          /* We include an extra 0 byte so these can be used as C strings.*/
          p_env->psz_mcn    = calloc(1, CDIO_MCN_SIZE+1);
  
+           disc_mode = _dao_common->u.unknown[2];
+           memcpy(p_env->psz_mcn, &(_dao_common->psz_mcn), CDIO_MCN_SIZE-1);
+         p_env->psz_mcn[CDIO_MCN_SIZE] = '\0';
+ 
          if (DAOX_ID == opcode) {
!           _daox_t *_entries = (void *) chunk->data;
!           p_env->dtyp = _entries->track_info[0].common.u.unknown[0];
          } else {
!           _daoi_t *_entries = (void *) chunk->data;
!           p_env->dtyp = _entries->track_info[0].common.u.unknown[0];
          }
  
          p_env->is_dao = true;
diff -cr libcdio-0.80-clean/lib/driver/image/nrg.h 
libcdio-0.80/lib/driver/image/nrg.h
*** libcdio-0.80-clean/lib/driver/image/nrg.h   Sat Jan 14 04:45:44 2006
--- libcdio-0.80/lib/driver/image/nrg.h Sat Mar  8 22:33:29 2008
***************
*** 71,89 ****
    uint32_t lsn        GNUC_PACKED; 
  } _cuex_array_t;
  
  typedef struct {
!   uint32_t _unknown1  GNUC_PACKED;
!   char      psz_mcn[CDIO_MCN_SIZE];             
!   uint8_t  _unknown[64-CDIO_MCN_SIZE-sizeof(uint32_t)];
  } _daox_array_t;
  
  typedef struct {
!   uint32_t _unknown1  GNUC_PACKED;
!   char      psz_mcn[CDIO_MCN_SIZE];
!   uint8_t  _unknown[64-CDIO_MCN_SIZE-sizeof(uint32_t)];
  } _daoi_array_t;
  
  typedef struct {
    uint32_t id                    GNUC_PACKED;
    uint32_t len                   GNUC_PACKED;
    char data[EMPTY_ARRAY_SIZE];
--- 71,124 ----
    uint32_t lsn        GNUC_PACKED; 
  } _cuex_array_t;
  
+ /* New DAO[XI] Information from http://en.wikipedia.org/wiki/NRG_(file_format)
+ */
+ 
  typedef struct {
!   uint8_t    zero[10];
!   uint32_t   sector_size         GNUC_PACKED;
!   union {
!     uint32_t mode                GNUC_PACKED;
!     uint8_t  unknown[4];
!   } u;
! } _dao_array_common_t;
! 
! typedef struct {
!   _dao_array_common_t common;
!   uint64_t   index0              GNUC_PACKED;
!   uint64_t   index1              GNUC_PACKED;
!   uint64_t   end_of_track        GNUC_PACKED;
  } _daox_array_t;
  
  typedef struct {
!   _dao_array_common_t common;
!   uint32_t   index0              GNUC_PACKED;
!   uint32_t   index1              GNUC_PACKED;
!   uint32_t   end_of_track        GNUC_PACKED;
  } _daoi_array_t;
  
  typedef struct {
+   uint32_t   chunk_size_le       GNUC_PACKED;
+   char       psz_mcn[CDIO_MCN_SIZE-1];
+   union {
+     uint32_t toc_type            GNUC_PACKED;
+     uint8_t  unknown[4];
+   } u;
+   uint8_t    first_track;
+   uint8_t    last_track;
+ } _dao_common_t;
+ 
+ typedef struct {
+   _dao_common_t common;
+   _daox_array_t track_info[EMPTY_ARRAY_SIZE];
+ } _daox_t;
+ 
+ typedef struct {
+   _dao_common_t common;
+   _daoi_array_t track_info[EMPTY_ARRAY_SIZE];
+ } _daoi_t;
+ 
+ typedef struct {
    uint32_t id                    GNUC_PACKED;
    uint32_t len                   GNUC_PACKED;
    char data[EMPTY_ARRAY_SIZE];

reply via email to

[Prev in Thread] Current Thread [Next in Thread]