Browse Source

Fix 64-bit bug in peakfile handling.

Use 'packed' attribute on structs used to represent individual peaks and peak headers.
This is a quick, if not ideal, solution.

Broken peakfiles generated on 64-bit platforms must be deleted!
tags/non-daw-v1.1.0
Jonathan Moore Liles 15 years ago
parent
commit
dea3ae913b
2 changed files with 7 additions and 4 deletions
  1. +1
    -1
      timeline/src/Engine/Peak.H
  2. +6
    -3
      timeline/src/Engine/Peaks.C

+ 1
- 1
timeline/src/Engine/Peak.H View File

@@ -24,4 +24,4 @@ struct Peak {
float max; float max;


float normalization_factor ( void ) const; float normalization_factor ( void ) const;
};
} __attribute__ (( packed ));

+ 6
- 3
timeline/src/Engine/Peaks.C View File

@@ -51,6 +51,8 @@
using std::min; using std::min;
using std::max; using std::max;


#include <stdint.h>



/* whether to cache peaks at multiple resolutions on disk to /* whether to cache peaks at multiple resolutions on disk to
@@ -102,11 +104,12 @@ Peaks::fill_buffer ( float fpp, nframes_t s, nframes_t e ) const
return read_peaks( s, (e - s) / fpp, fpp ); return read_peaks( s, (e - s) / fpp, fpp );
} }



struct peakfile_block_header struct peakfile_block_header
{ {
unsigned long chunksize;
unsigned long skip;
};
uint32_t chunksize;
uint32_t skip;
} __attribute__ (( packed ));


class Peakfile class Peakfile
{ {


Loading…
Cancel
Save