]> git.pld-linux.org Git - packages/kino.git/blob - kino-fix_avi_packing.patch
- up to 1.0
[packages/kino.git] / kino-fix_avi_packing.patch
1 #! /bin/sh /usr/share/dpatch/dpatch-run
2 ## Paul Brossier <piem@debian.org>
3 ## DP: fix avi.h packed attribute for gcc-4.0 
4
5 @DPATCH@
6 --- kino-0.8.0/src/avi.h        2005-10-20 07:28:39.000000000 +0100
7 +++ kino-0.80/src/avi.h 2005-11-28 18:57:02.782807000 +0000
8 @@ -31,7 +31,7 @@
9  #include "riff.h"
10  #include "frame.h"
11  
12 -#define PACKED(x)      __attribute__((packed)) x
13 +#define PACKED(x)      x __attribute__((packed))
14  
15  #define AVI_SMALL_INDEX (0x01)
16  #define AVI_LARGE_INDEX (0x02)
17 @@ -48,35 +48,35 @@
18  typedef struct
19  {
20         /// frame display rate (or 0L)
21 -       DWORD dwMicroSecPerFrame;
22 +       DWORD PACKED(dwMicroSecPerFrame);
23  
24         /// max. transfer rate
25 -       DWORD dwMaxBytesPerSec;
26 +       DWORD PACKED(dwMaxBytesPerSec);
27  
28         /// pad to multiples of this size, normally 2K
29 -       DWORD dwPaddingGranularity;
30 +       DWORD PACKED(dwPaddingGranularity);
31  
32         /// the ever-present flags
33 -       DWORD dwFlags;
34 +       DWORD PACKED(dwFlags);
35  
36         /// # frames in file
37 -       DWORD dwTotalFrames;
38 -       DWORD dwInitialFrames;
39 -       DWORD dwStreams;
40 -       DWORD dwSuggestedBufferSize;
41 +       DWORD PACKED(dwTotalFrames);
42 +       DWORD PACKED(dwInitialFrames);
43 +       DWORD PACKED(dwStreams);
44 +       DWORD PACKED(dwSuggestedBufferSize);
45  
46 -       DWORD dwWidth;
47 -       DWORD dwHeight;
48 +       DWORD PACKED(dwWidth);
49 +       DWORD PACKED(dwHeight);
50  
51 -       DWORD dwReserved[ 4 ];
52 +       DWORD PACKED(dwReserved[ 4 ]);
53  }
54 -PACKED(MainAVIHeader);
55 +MainAVIHeader;
56  
57  typedef struct
58  {
59 -       WORD top, bottom, left, right;
60 +       WORD PACKED(top), PACKED(bottom), PACKED(left), PACKED(right);
61  }
62 -PACKED(RECT);
63 +RECT;
64  
65  /** Declaration of a stream header
66   
67 @@ -84,113 +84,113 @@
68  
69  typedef struct
70  {
71 -       FOURCC fccType;
72 -       FOURCC fccHandler;
73 -       DWORD dwFlags;                /* Contains AVITF_* flags */
74 -       WORD wPriority;
75 -       WORD wLanguage;
76 -       DWORD dwInitialFrames;
77 -       DWORD dwScale;
78 -       DWORD dwRate;                 /* dwRate / dwScale == samples/second */
79 -       DWORD dwStart;
80 -       DWORD dwLength;               /* In units above... */
81 -       DWORD dwSuggestedBufferSize;
82 -       DWORD dwQuality;
83 -       DWORD dwSampleSize;
84 -       RECT rcFrame;
85 +       FOURCC PACKED(fccType);
86 +       FOURCC PACKED(fccHandler);
87 +       DWORD PACKED(dwFlags);                /* Contains AVITF_* flags */
88 +       WORD PACKED(wPriority);
89 +       WORD PACKED(wLanguage);
90 +       DWORD PACKED(dwInitialFrames);
91 +       DWORD PACKED(dwScale);
92 +       DWORD PACKED(dwRate);                 /* dwRate / dwScale == samples/second */
93 +       DWORD PACKED(dwStart);
94 +       DWORD PACKED(dwLength);               /* In units above... */
95 +       DWORD PACKED(dwSuggestedBufferSize);
96 +       DWORD PACKED(dwQuality);
97 +       DWORD PACKED(dwSampleSize);
98 +       RECT PACKED(rcFrame);
99  }
100 -PACKED(AVIStreamHeader);
101 +AVIStreamHeader;
102  
103  typedef struct
104  {
105 -       DWORD dwDVAAuxSrc;
106 -       DWORD dwDVAAuxCtl;
107 -       DWORD dwDVAAuxSrc1;
108 -       DWORD dwDVAAuxCtl1;
109 -       DWORD dwDVVAuxSrc;
110 -       DWORD dwDVVAuxCtl;
111 -       DWORD dwDVReserved[ 2 ];
112 +       DWORD PACKED(dwDVAAuxSrc);
113 +       DWORD PACKED(dwDVAAuxCtl);
114 +       DWORD PACKED(dwDVAAuxSrc1);
115 +       DWORD PACKED(dwDVAAuxCtl1);
116 +       DWORD PACKED(dwDVVAuxSrc);
117 +       DWORD PACKED(dwDVVAuxCtl);
118 +       DWORD PACKED(dwDVReserved[ 2 ]);
119  }
120 -PACKED(DVINFO);
121 +DVINFO;
122  
123  typedef struct
124  {
125 -       DWORD biSize;
126 -       LONG biWidth;
127 -       LONG biHeight;
128 -       WORD biPlanes;
129 -       WORD biBitCount;
130 -       DWORD biCompression;
131 -       DWORD biSizeImage;
132 -       LONG biXPelsPerMeter;
133 -       LONG biYPelsPerMeter;
134 -       DWORD biClrUsed;
135 -       DWORD biClrImportant;
136 +       DWORD PACKED(biSize);
137 +       LONG PACKED(biWidth);
138 +       LONG PACKED(biHeight);
139 +       WORD PACKED(biPlanes);
140 +       WORD PACKED(biBitCount);
141 +       DWORD PACKED(biCompression);
142 +       DWORD PACKED(biSizeImage);
143 +       LONG PACKED(biXPelsPerMeter);
144 +       LONG PACKED(biYPelsPerMeter);
145 +       DWORD PACKED(biClrUsed);
146 +       DWORD PACKED(biClrImportant);
147  }
148 -PACKED(BITMAPINFOHEADER);
149 +BITMAPINFOHEADER;
150  
151  typedef struct
152  {
153 -       WORD wFormatTag;
154 -       WORD nChannels;
155 -       DWORD nSamplesPerSec;
156 -       DWORD nAvgBytesPerSec;
157 -       WORD nBlockAlign;
158 -       WORD wBitsPerSample;
159 -       WORD cbSize;
160 -       WORD dummy;
161 +       WORD PACKED(wFormatTag);
162 +       WORD PACKED(nChannels);
163 +       DWORD PACKED(nSamplesPerSec);
164 +       DWORD PACKED(nAvgBytesPerSec);
165 +       WORD PACKED(nBlockAlign);
166 +       WORD PACKED(wBitsPerSample);
167 +       WORD PACKED(cbSize);
168 +       WORD PACKED(dummy);
169  }
170 -PACKED(WAVEFORMATEX);
171 +WAVEFORMATEX;
172  
173  typedef struct
174  {
175 -       WORD wLongsPerEntry;
176 -       BYTE bIndexSubType;
177 -       BYTE bIndexType;
178 -       DWORD nEntriesInUse;
179 -       FOURCC dwChunkId;
180 -       DWORD dwReserved[ 3 ];
181 +       WORD PACKED(wLongsPerEntry);
182 +       BYTE PACKED(bIndexSubType);
183 +       BYTE PACKED(bIndexType);
184 +       DWORD PACKED(nEntriesInUse);
185 +       FOURCC PACKED(dwChunkId);
186 +       DWORD PACKED(dwReserved[ 3 ]);
187         struct avisuperindex_entry
188         {
189 -               QUADWORD qwOffset;
190 -               DWORD dwSize;
191 -               DWORD dwDuration;
192 +               QUADWORD PACKED(qwOffset);
193 +               DWORD PACKED(dwSize);
194 +               DWORD PACKED(dwDuration);
195         }
196         aIndex[ 2014 ];
197  }
198 -PACKED(AVISuperIndex);
199 +AVISuperIndex;
200  
201  typedef struct
202  {
203 -       WORD wLongsPerEntry;
204 -       BYTE bIndexSubType;
205 -       BYTE bIndexType;
206 -       DWORD nEntriesInUse;
207 -       FOURCC dwChunkId;
208 -       QUADWORD qwBaseOffset;
209 -       DWORD dwReserved;
210 +       WORD PACKED(wLongsPerEntry);
211 +       BYTE PACKED(bIndexSubType);
212 +       BYTE PACKED(bIndexType);
213 +       DWORD PACKED(nEntriesInUse);
214 +       FOURCC PACKED(dwChunkId);
215 +       QUADWORD PACKED(qwBaseOffset);
216 +       DWORD PACKED(dwReserved);
217         struct avifieldindex_entry
218         {
219 -               DWORD dwOffset;
220 -               DWORD dwSize;
221 +               DWORD PACKED(dwOffset);
222 +               DWORD PACKED(dwSize);
223         }
224 -       aIndex[ 17895 ];
225 +       aIndex[ 4028 ];
226  }
227 -PACKED(AVIStdIndex);
228 +AVIStdIndex;
229  
230  typedef struct
231  {
232         struct avisimpleindex_entry
233         {
234 -               FOURCC  dwChunkId;
235 -               DWORD   dwFlags;
236 -               DWORD   dwOffset;
237 -               DWORD   dwSize;
238 +               FOURCC PACKED(dwChunkId);
239 +               DWORD PACKED(dwFlags);
240 +               DWORD PACKED(dwOffset);
241 +               DWORD PACKED(dwSize);
242         }
243         aIndex[ 20000 ];
244 -       DWORD   nEntriesInUse;
245 +       DWORD PACKED(nEntriesInUse);
246  }
247 -PACKED(AVISimpleIndex);
248 +AVISimpleIndex;
249  
250  typedef struct
251  {
This page took 0.067758 seconds and 3 git commands to generate.