| 133 | } |
| 134 | |
| 135 | result TedSid::loadMem(unsigned char *aMem, unsigned int aLength, bool aCopy, bool aTakeOwnership) |
| 136 | { |
| 137 | if (!aMem || aLength == 0) |
| 138 | return INVALID_PARAMETER; |
| 139 | MemoryFile *mf = new MemoryFile; |
| 140 | if (!mf) |
| 141 | return OUT_OF_MEMORY; |
| 142 | int res = mf->openMem(aMem, aLength, aCopy, aTakeOwnership); |
| 143 | if (res != SO_NO_ERROR) |
| 144 | { |
| 145 | delete mf; |
| 146 | return res; |
| 147 | } |
| 148 | res = loadFile(mf); |
| 149 | if (res != SO_NO_ERROR) |
| 150 | { |
| 151 | delete mf; |
| 152 | return res; |
| 153 | } |
| 154 | mFileOwned = aCopy || aTakeOwnership; |
| 155 | |
| 156 | return SO_NO_ERROR; |
| 157 | } |
| 158 | |
| 159 | result TedSid::load(const char *aFilename) |
| 160 | { |