Ignore:
Timestamp:
Jan 24, 2014, 5:09:50 PM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
5ab8e59
Parents:
16dda03
Message:

src/io/*apple*: improve error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/utils_apple_audio.c

    r16dda03 r98a3887  
    1010void freeAudioBufferList(AudioBufferList *bufferList);
    1111CFURLRef getURLFromPath(const char * path);
     12char_t *getPrintableOSStatusError(char_t *str, OSStatus error);
    1213
    1314int createAubioBufferList(AudioBufferList * bufferList, int channels, int max_source_samples) {
     
    3940}
    4041
     42char_t *getPrintableOSStatusError(char_t *str, OSStatus error)
     43{
     44    // see if it appears to be a 4-char-code
     45    *(UInt32 *)(str + 1) = CFSwapInt32HostToBig(error);
     46    if (isprint(str[1]) && isprint(str[2]) && isprint(str[3]) && isprint(str[4])) {
     47        str[0] = str[5] = '\'';
     48        str[6] = '\0';
     49    } else
     50        // no, format it as an integer
     51        sprintf(str, "%d", (int)error);
     52    return str;
     53}
     54
    4155#endif /* __APPLE__ */
Note: See TracChangeset for help on using the changeset viewer.