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

Function ilIsValidMp3

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

Checks if the file specified in FileName is a valid MP3 file.

Source from the content-addressed store, hash-verified

35
36//! Checks if the file specified in FileName is a valid MP3 file.
37ILboolean ilIsValidMp3(ILconst_string FileName)
38{
39 ILHANDLE Mp3File;
40 ILboolean bMp3 = IL_FALSE;
41
42 if (!iCheckExtension(FileName, IL_TEXT("mp3"))) {
43 ilSetError(IL_INVALID_EXTENSION);
44 return bMp3;
45 }
46
47 Mp3File = iopenr(FileName);
48 if (Mp3File == NULL) {
49 ilSetError(IL_COULD_NOT_OPEN_FILE);
50 return bMp3;
51 }
52
53 bMp3 = ilIsValidMp3F(Mp3File);
54 icloser(Mp3File);
55
56 return bMp3;
57}
58
59
60//! Checks if the ILHANDLE contains a valid MP3 file at the current position.

Callers 1

ILAPIENTRY ilIsValidFunction · 0.85

Calls 3

iCheckExtensionFunction · 0.85
ilSetErrorFunction · 0.85
ilIsValidMp3FFunction · 0.85

Tested by

no test coverage detected