libmp4v2: add gcc 10 compatibility patch
[AGL/meta-agl-demo.git] / recipes-multimedia / libmp4v2 / files / gcc10.patch
1 Fix compilation with gcc 10
2
3 Patch pulled from Fedora source RPM:
4 https://dl.fedoraproject.org/pub/fedora/linux/development/34/Everything/source/tree/Packages/l/libmp4v2-2.1.0-0.23.trunkREV507.fc34.src.rpm
5
6 Upstream-Status: Inappropriate[no upstream]
7 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
8
9 ---
10 diff -Nrup a/libutil/Utility.cpp b/libutil/Utility.cpp
11 --- a/libutil/Utility.cpp       2015-04-24 09:37:49.000000000 -0600
12 +++ b/libutil/Utility.cpp       2019-09-24 12:39:23.669103515 -0600
13 @@ -531,26 +531,26 @@ Utility::process_impl()
14                  printHelp( false, false );
15                  return SUCCESS;
16  
17 -            case LC_DEBUG:
18 +            case int(LC_DEBUG):
19                  debugUpdate( std::strtoul( prog::optarg, NULL, 0 ) );
20                  break;
21  
22 -            case LC_VERBOSE:
23 +            case int(LC_VERBOSE):
24              {
25                  const uint32_t level = std::strtoul( prog::optarg, NULL, 0 );
26                  _verbosity = ( level < 4 ) ? level : 3;
27                  break;
28              }
29  
30 -            case LC_HELP:
31 +            case int(LC_HELP):
32                  printHelp( true, false );
33                  return SUCCESS;
34  
35 -            case LC_VERSION:
36 +            case int(LC_VERSION):
37                  printVersion( false );
38                  return SUCCESS;
39  
40 -            case LC_VERSIONX:
41 +            case int(LC_VERSIONX):
42                  printVersion( true );
43                  return SUCCESS;
44  
45 diff -Nrup a/util/mp4art.cpp b/util/mp4art.cpp
46 --- a/util/mp4art.cpp   2015-04-24 09:37:49.000000000 -0600
47 +++ b/util/mp4art.cpp   2019-09-24 12:32:35.078171912 -0600
48 @@ -377,11 +377,11 @@ ArtUtility::utility_option( int code, bo
49      handled = true;
50  
51      switch( code ) {
52 -        case LC_ART_ANY:
53 +        case int(LC_ART_ANY):
54              _artFilter = numeric_limits<uint32_t>::max();
55              break;
56  
57 -        case LC_ART_INDEX:
58 +        case int(LC_ART_INDEX):
59          {
60              istringstream iss( prog::optarg );
61              iss >> _artFilter;
62 @@ -390,29 +390,29 @@ ArtUtility::utility_option( int code, bo
63              break;
64          }
65  
66 -        case LC_LIST:
67 +        case int(LC_LIST):
68              _action = &ArtUtility::actionList;
69              break;
70  
71 -        case LC_ADD:
72 +        case int(LC_ADD):
73              _action = &ArtUtility::actionAdd;
74              _artImageFile = prog::optarg;
75              if( _artImageFile.empty() )
76                  return herrf( "invalid image file: empty-string\n" );
77              break;
78  
79 -        case LC_REMOVE:
80 +        case int(LC_REMOVE):
81              _action = &ArtUtility::actionRemove;
82              break;
83  
84 -        case LC_REPLACE:
85 +        case int(LC_REPLACE):
86              _action = &ArtUtility::actionReplace;
87              _artImageFile = prog::optarg;
88              if( _artImageFile.empty() )
89                  return herrf( "invalid image file: empty-string\n" );
90              break;
91  
92 -        case LC_EXTRACT:
93 +        case int(LC_EXTRACT):
94              _action = &ArtUtility::actionExtract;
95              break;
96  
97 diff -Nrup a/util/mp4chaps.cpp b/util/mp4chaps.cpp
98 --- a/util/mp4chaps.cpp 2015-04-24 09:37:49.000000000 -0600
99 +++ b/util/mp4chaps.cpp 2019-09-24 12:35:24.121316167 -0600
100 @@ -634,32 +634,32 @@ ChapterUtility::utility_option( int code
101  
102      switch( code ) {
103          case 'A':
104 -        case LC_CHPT_ANY:
105 +        case int(LC_CHPT_ANY):
106              _ChapterType = MP4ChapterTypeAny;
107              break;
108  
109          case 'Q':
110 -        case LC_CHPT_QT:
111 +        case int(LC_CHPT_QT):
112              _ChapterType = MP4ChapterTypeQt;
113              break;
114  
115          case 'N':
116 -        case LC_CHPT_NERO:
117 +        case int(LC_CHPT_NERO):
118              _ChapterType = MP4ChapterTypeNero;
119              break;
120  
121          case 'C':
122 -        case LC_CHPT_COMMON:
123 +        case int(LC_CHPT_COMMON):
124              _ChapterFormat = CHPT_FMT_COMMON;
125              break;
126  
127          case 'l':
128 -        case LC_CHP_LIST:
129 +        case int(LC_CHP_LIST):
130              _action = &ChapterUtility::actionList;
131              break;
132  
133          case 'e':
134 -        case LC_CHP_EVERY:
135 +        case int(LC_CHP_EVERY):
136          {
137              istringstream iss( prog::optarg );
138              iss >> _ChaptersEvery;
139 @@ -675,7 +675,7 @@ ChapterUtility::utility_option( int code
140              _action = &ChapterUtility::actionExport;
141              break;
142  
143 -        case LC_CHP_EXPORT:
144 +        case int(LC_CHP_EXPORT):
145              _action = &ChapterUtility::actionExport;
146              /* currently not supported since the chapters of n input files would be written to one chapter file
147              _ChapterFile = prog::optarg;
148 @@ -690,7 +690,7 @@ ChapterUtility::utility_option( int code
149              _action = &ChapterUtility::actionImport;
150              break;
151  
152 -        case LC_CHP_IMPORT:
153 +        case int(LC_CHP_IMPORT):
154              _action = &ChapterUtility::actionImport;
155              /* currently not supported since the chapters of n input files would be read from one chapter file
156              _ChapterFile = prog::optarg;
157 @@ -702,12 +702,12 @@ ChapterUtility::utility_option( int code
158              break;
159  
160          case 'c':
161 -        case LC_CHP_CONVERT:
162 +        case int(LC_CHP_CONVERT):
163              _action = &ChapterUtility::actionConvert;
164              break;
165  
166          case 'r':
167 -        case LC_CHP_REMOVE:
168 +        case int(LC_CHP_REMOVE):
169              _action = &ChapterUtility::actionRemove;
170              break;
171  
172 diff -Nrup a/util/mp4file.cpp b/util/mp4file.cpp
173 --- a/util/mp4file.cpp  2015-04-24 09:37:49.000000000 -0600
174 +++ b/util/mp4file.cpp  2019-09-24 12:33:09.735996459 -0600
175 @@ -190,15 +190,15 @@ FileUtility::utility_option( int code, b
176      handled = true;
177  
178      switch( code ) {
179 -        case LC_LIST:
180 +        case int(LC_LIST):
181              _action = &FileUtility::actionList;
182              break;
183  
184 -        case LC_OPTIMIZE:
185 +        case int(LC_OPTIMIZE):
186              _action = &FileUtility::actionOptimize;
187              break;
188  
189 -        case LC_DUMP:
190 +        case int(LC_DUMP):
191              _action = &FileUtility::actionDump;
192              break;
193  
194 diff -Nrup a/util/mp4subtitle.cpp b/util/mp4subtitle.cpp
195 --- a/util/mp4subtitle.cpp      2015-04-24 09:37:49.000000000 -0600
196 +++ b/util/mp4subtitle.cpp      2019-09-24 12:33:53.739773682 -0600
197 @@ -165,25 +165,25 @@ SubtitleUtility::utility_option( int cod
198      handled = true;
199  
200      switch( code ) {
201 -        case LC_LIST:
202 +        case int(LC_LIST):
203              _action = &SubtitleUtility::actionList;
204              break;
205  
206 -        case LC_EXPORT:
207 +        case int(LC_EXPORT):
208              _action = &SubtitleUtility::actionExport;
209              _stTextFile = prog::optarg;
210              if( _stTextFile.empty() )
211                  return herrf( "invalid TXT file: empty-string\n" );
212              break;
213  
214 -        case LC_IMPORT:
215 +        case int(LC_IMPORT):
216              _action = &SubtitleUtility::actionImport;
217              _stTextFile = prog::optarg;
218              if( _stTextFile.empty() )
219                  return herrf( "invalid TXT file: empty-string\n" );
220              break;
221  
222 -        case LC_REMOVE:
223 +        case int(LC_REMOVE):
224              _action = &SubtitleUtility::actionRemove;
225              break;
226  
227 diff -Nrup a/util/mp4track.cpp b/util/mp4track.cpp
228 --- a/util/mp4track.cpp 2015-04-24 09:37:49.000000000 -0600
229 +++ b/util/mp4track.cpp 2019-09-24 12:37:02.934815918 -0600
230 @@ -789,11 +789,11 @@ TrackUtility::utility_option( int code,
231      handled = true;
232  
233      switch( code ) {
234 -        case LC_TRACK_WILDCARD:
235 +        case int(LC_TRACK_WILDCARD):
236              _trackMode = TM_WILDCARD;
237              break;
238  
239 -        case LC_TRACK_INDEX:
240 +        case int(LC_TRACK_INDEX):
241          {
242              _trackMode = TM_INDEX;
243              istringstream iss( prog::optarg );
244 @@ -803,7 +803,7 @@ TrackUtility::utility_option( int code,
245              break;
246          }
247  
248 -        case LC_TRACK_ID:
249 +        case int(LC_TRACK_ID):
250          {
251              _trackMode = TM_ID;
252              istringstream iss( prog::optarg );
253 @@ -813,142 +813,142 @@ TrackUtility::utility_option( int code,
254              break;
255          }
256  
257 -        case LC_LIST:
258 +        case int(LC_LIST):
259              _action = &TrackUtility::actionList;
260              break;
261  
262 -        case LC_COLR_PARMS:
263 +        case int(LC_COLR_PARMS):
264              _colorParameterItem.convertFromCSV( prog::optarg );
265              break;
266  
267 -        case LC_COLR_PARM_HD:
268 +        case int(LC_COLR_PARM_HD):
269              _colorParameterItem.primariesIndex        = 1;
270              _colorParameterItem.transferFunctionIndex = 1;
271              _colorParameterItem.matrixIndex           = 1;
272              break;
273  
274 -        case LC_COLR_PARM_SD:
275 +        case int(LC_COLR_PARM_SD):
276              _colorParameterItem.primariesIndex        = 6;
277              _colorParameterItem.transferFunctionIndex = 1;
278              _colorParameterItem.matrixIndex           = 6;
279              break;
280  
281 -        case LC_COLR_LIST:
282 +        case int(LC_COLR_LIST):
283              _action = &TrackUtility::actionColorParameterList;
284              break;
285  
286 -        case LC_ENABLED:
287 +        case int(LC_ENABLED):
288              _action = &TrackUtility::actionTrackModifierSet;
289              _actionTrackModifierSet_function = &TrackModifier::setEnabled;
290              _actionTrackModifierSet_name     = "enabled";
291              _actionTrackModifierSet_value    = prog::optarg;
292              break;
293  
294 -        case LC_INMOVIE:
295 +        case int(LC_INMOVIE):
296              _action = &TrackUtility::actionTrackModifierSet;
297              _actionTrackModifierSet_function = &TrackModifier::setInMovie;
298              _actionTrackModifierSet_name     = "inMovie";
299              _actionTrackModifierSet_value    = prog::optarg;
300              break;
301  
302 -        case LC_INPREVIEW:
303 +        case int(LC_INPREVIEW):
304              _action = &TrackUtility::actionTrackModifierSet;
305              _actionTrackModifierSet_function = &TrackModifier::setInPreview;
306              _actionTrackModifierSet_name     = "inPreview";
307              _actionTrackModifierSet_value    = prog::optarg;
308              break;
309  
310 -        case LC_LAYER:
311 +        case int(LC_LAYER):
312              _action = &TrackUtility::actionTrackModifierSet;
313              _actionTrackModifierSet_function = &TrackModifier::setLayer;
314              _actionTrackModifierSet_name     = "layer";
315              _actionTrackModifierSet_value    = prog::optarg;
316              break;
317  
318 -        case LC_ALTGROUP:
319 +        case int(LC_ALTGROUP):
320              _action = &TrackUtility::actionTrackModifierSet;
321              _actionTrackModifierSet_function = &TrackModifier::setAlternateGroup;
322              _actionTrackModifierSet_name     = "alternateGroup";
323              _actionTrackModifierSet_value    = prog::optarg;
324              break;
325  
326 -        case LC_VOLUME:
327 +        case int(LC_VOLUME):
328              _action = &TrackUtility::actionTrackModifierSet;
329              _actionTrackModifierSet_function = &TrackModifier::setVolume;
330              _actionTrackModifierSet_name     = "volume";
331              _actionTrackModifierSet_value    = prog::optarg;
332              break;
333  
334 -        case LC_WIDTH:
335 +        case int(LC_WIDTH):
336              _action = &TrackUtility::actionTrackModifierSet;
337              _actionTrackModifierSet_function = &TrackModifier::setWidth;
338              _actionTrackModifierSet_name     = "width";
339              _actionTrackModifierSet_value    = prog::optarg;
340              break;
341  
342 -        case LC_HEIGHT:
343 +        case int(LC_HEIGHT):
344              _action = &TrackUtility::actionTrackModifierSet;
345              _actionTrackModifierSet_function = &TrackModifier::setHeight;
346              _actionTrackModifierSet_name     = "height";
347              _actionTrackModifierSet_value    = prog::optarg;
348              break;
349  
350 -        case LC_LANGUAGE:
351 +        case int(LC_LANGUAGE):
352              _action = &TrackUtility::actionTrackModifierSet;
353              _actionTrackModifierSet_function = &TrackModifier::setLanguage;
354              _actionTrackModifierSet_name     = "language";
355              _actionTrackModifierSet_value    = prog::optarg;
356              break;
357  
358 -        case LC_HDLRNAME:
359 +        case int(LC_HDLRNAME):
360              _action = &TrackUtility::actionTrackModifierSet;
361              _actionTrackModifierSet_function = &TrackModifier::setHandlerName;
362              _actionTrackModifierSet_name     = "handlerName";
363              _actionTrackModifierSet_value    = prog::optarg;
364              break;
365  
366 -        case LC_UDTANAME:
367 +        case int(LC_UDTANAME):
368              _action = &TrackUtility::actionTrackModifierSet;
369              _actionTrackModifierSet_function = &TrackModifier::setUserDataName;
370              _actionTrackModifierSet_name     = "userDataName";
371              _actionTrackModifierSet_value    = prog::optarg;
372              break;
373  
374 -        case LC_UDTANAME_R:
375 +        case int(LC_UDTANAME_R):
376              _action = &TrackUtility::actionTrackModifierRemove;
377              _actionTrackModifierRemove_function = &TrackModifier::removeUserDataName;
378              _actionTrackModifierRemove_name     = "userDataName";
379              break;
380  
381 -        case LC_COLR_ADD:
382 +        case int(LC_COLR_ADD):
383              _action = &TrackUtility::actionColorParameterAdd;
384              break;
385  
386 -        case LC_COLR_SET:
387 +        case int(LC_COLR_SET):
388              _action = &TrackUtility::actionColorParameterSet;
389              break;
390  
391 -        case LC_COLR_REMOVE:
392 +        case int(LC_COLR_REMOVE):
393              _action = &TrackUtility::actionColorParameterRemove;
394              break;
395  
396 -        case LC_PASP_PARMS:
397 +        case int(LC_PASP_PARMS):
398              _pictureAspectRatioItem.convertFromCSV( prog::optarg );
399              break;
400  
401 -        case LC_PASP_LIST:
402 +        case int(LC_PASP_LIST):
403              _action = &TrackUtility::actionPictureAspectRatioList;
404              break;
405  
406 -        case LC_PASP_ADD:
407 +        case int(LC_PASP_ADD):
408              _action = &TrackUtility::actionPictureAspectRatioAdd;
409              break;
410  
411 -        case LC_PASP_SET:
412 +        case int(LC_PASP_SET):
413              _action = &TrackUtility::actionPictureAspectRatioSet;
414              break;
415  
416 -        case LC_PASP_REMOVE:
417 +        case int(LC_PASP_REMOVE):
418              _action = &TrackUtility::actionPictureAspectRatioRemove;
419              break;
420