MCPcopy Create free account
hub / github.com/DentonW/DevIL / iLoadMp3Internal

Function iLoadMp3Internal

DevIL/src-IL/src/il_mp3.cpp:243–277  ·  view source on GitHub ↗

Internal function used to load the MP3.

Source from the content-addressed store, hash-verified

241
242// Internal function used to load the MP3.
243ILboolean iLoadMp3Internal(void)
244{
245 MP3HEAD Header;
246 ILuint Type;
247
248 if (iCurImage == NULL) {
249 ilSetError(IL_ILLEGAL_OPERATION);
250 return IL_FALSE;
251 }
252
253 if (!iGetMp3Head(&Header))
254 return IL_FALSE;
255 if (!iCheckMp3(&Header))
256 return IL_FALSE;
257 Type = iFindMp3Pic(&Header);
258
259 switch (Type)
260 {
261#ifndef IL_NO_JPG
262 case MP3_JPG:
263 return iLoadJpegInternal();
264#endif//IL_NO_JPG
265
266#ifndef IL_NO_PNG
267 case MP3_PNG:
268 return iLoadPngInternal();
269#endif//IL_NO_PNG
270
271 // Either a picture was not found, or the MIME type was not recognized.
272 default:
273 ilSetError(IL_INVALID_FILE_HEADER);
274 }
275
276 return IL_FALSE;
277}
278
279#endif//IL_NO_MP3
280

Callers 2

ilLoadMp3FFunction · 0.85
ilLoadMp3LFunction · 0.85

Calls 6

ilSetErrorFunction · 0.85
iGetMp3HeadFunction · 0.85
iCheckMp3Function · 0.85
iFindMp3PicFunction · 0.85
iLoadJpegInternalFunction · 0.85
iLoadPngInternalFunction · 0.85

Tested by

no test coverage detected