Correctly using __attribute__ ((packed)); some small improvements.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2862 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+1
-1
@@ -190,7 +190,7 @@ free_chunks(struct aifc_Chunk **chunks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
convert_aif(FILE *in, FILE *out) {
|
convert_aif(FILE *in, FILE *out) {
|
||||||
struct aifc_Chunk **chunks;
|
struct aifc_Chunk **chunks;
|
||||||
struct aifc_FormatVersionChunk *fverChunk;
|
struct aifc_FormatVersionChunk *fverChunk;
|
||||||
struct aifc_ExtCommonChunk *commChunk;
|
struct aifc_ExtCommonChunk *commChunk;
|
||||||
|
|||||||
+7
-7
@@ -26,7 +26,7 @@ struct aifc_ChunkHeader {
|
|||||||
struct aifc_Chunk {
|
struct aifc_Chunk {
|
||||||
aifc_ID ckID; /* Chunk ID */
|
aifc_ID ckID; /* Chunk ID */
|
||||||
uint32_t ckSize; /* Chunk size, excluding header */
|
uint32_t ckSize; /* Chunk size, excluding header */
|
||||||
uint8_t ckData[1]; /* placeholder for data */
|
uint8_t ckData[]; /* placeholder for data */
|
||||||
};
|
};
|
||||||
|
|
||||||
struct aifc_ContainerChunk {
|
struct aifc_ContainerChunk {
|
||||||
@@ -46,17 +46,17 @@ struct aifc_ExtCommonChunk {
|
|||||||
aifc_ID ckID; /* "COMM" */
|
aifc_ID ckID; /* "COMM" */
|
||||||
uint32_t ckSize; /* size of chunk data */
|
uint32_t ckSize; /* size of chunk data */
|
||||||
uint16_t numChannels; /* number of channels */
|
uint16_t numChannels; /* number of channels */
|
||||||
uint32_t numSampleFrames __attribute__ ((packed));
|
uint32_t numSampleFrames;
|
||||||
/* number of sample frames */
|
/* number of sample frames */
|
||||||
uint16_t sampleSize __attribute__ ((packed));
|
uint16_t sampleSize;
|
||||||
/* number of bits per sample */
|
/* number of bits per sample */
|
||||||
aifc_Extended sampleRate __attribute__ ((packed));
|
aifc_Extended sampleRate;
|
||||||
/* number of frames per second */
|
/* number of frames per second */
|
||||||
aifc_ID compressionType __attribute__ ((packed));
|
aifc_ID compressionType;
|
||||||
/* compression type ID */
|
/* compression type ID */
|
||||||
char *compressionName;
|
char *compressionName;
|
||||||
/* compression type name */
|
/* compression type name */
|
||||||
};
|
} __attribute__ ((packed));
|
||||||
|
|
||||||
|
|
||||||
struct aifc_SoundDataChunk {
|
struct aifc_SoundDataChunk {
|
||||||
@@ -64,6 +64,6 @@ struct aifc_SoundDataChunk {
|
|||||||
uint32_t ckSize; /* size of chunk data */
|
uint32_t ckSize; /* size of chunk data */
|
||||||
uint32_t offset; /* offset to sound data */
|
uint32_t offset; /* offset to sound data */
|
||||||
uint32_t blocksize; /* size of alignment blocks */
|
uint32_t blocksize; /* size of alignment blocks */
|
||||||
uint8_t data[1]; /* placeholder for data */
|
uint8_t data[]; /* placeholder for data */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ echo "If this is not the case, files won't be converted correctly."
|
|||||||
echo "The sample rate is reported, so you can see if it goes wrong."
|
echo "The sample rate is reported, so you can see if it goes wrong."
|
||||||
|
|
||||||
echo "Press ENTER when ready."
|
echo "Press ENTER when ready."
|
||||||
read
|
read DUMMY
|
||||||
|
|
||||||
for FILE in *.aif; do
|
for FILE in *.aif; do
|
||||||
echo "File $FILE"
|
echo "File $FILE"
|
||||||
|
|||||||
Reference in New Issue
Block a user