Skip to content

Commit f9ac088

Browse files
authored
Added DRM protection error code to decoder (#810)
* Added DRM protection error code to decoder * Remove whitespaces
1 parent 2330828 commit f9ac088

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Superpowered/SuperpoweredDecoder.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class Decoder {
5454
static const int OpenError_ImplementationError1 = 1013; ///< Should never happen. But if it does, please let us know.
5555
static const int OpenError_ImplementationError2 = 1014; ///< Should never happen. But if it does, please let us know.
5656
static const int OpenError_UseSetTempFolder = 1015; ///< Call AdvancedAudioPlayer::setTempFolder first.
57+
static const int OpenError_DRMProtected = 1016; ///< The file is DRM-protected and cannot be decoded.
5758

5859
bool HLSAutomaticAlternativeSwitching; ///< If true, then the decoder will automatically switch between the HLS alternatives according to the available network bandwidth. Default: true.
5960
int HLSMaximumDownloadAttempts; ///< How many times to retry if a HLS segment download fails. Default: 100.
@@ -294,38 +295,38 @@ class AudioInMemory {
294295
/// @param size For compressed (not decoded) audio data: the total payload size in bytes. For raw 16-bit PCM audio: the total duration in frames. Set to 0 if unknown at the beginning (eg. progressive download). Set it at any point later if it gets known.
295296
/// @param completed False if additional buffers can be added (such as progressive download), true otherwise.
296297
JSWASM static void *create(unsigned int retainCount, unsigned int samplerate, unsigned int size, bool completed);
297-
298+
298299
/// @return Creates a main table with the payload included (special "self-contained" case).
299300
/// @param retainCount The retain count can be used to track usage (eg. multiple simultaneous access). If set to 0, the Decoder and the AdvancedAudioPlayer will take ownership on all the memory allocated (the main table, the buffer tables and their payloads) and will automatically free them using free(). The allocation should happen using malloc() (and not _aligned_malloc() or similar).
300301
/// @param samplerate Samplerate is used with the AdvancedAudioPlayer only (valid range is 8192 to 384000) and must be correctly set right at the beginning. Set it to 0 if using the Decoder.
301302
/// @param size For compressed (not decoded) audio data: the total payload size in bytes. For raw 16-bit PCM audio: the total duration in frames. Set to 0 if unknown at the beginning (eg. progressive download). Set it at any point later if it gets known.
302303
JSWASM static void *createSelfContained(unsigned int retainCount, unsigned int samplerate, unsigned int size);
303-
304+
304305
/// @brief Adds 1 to retain count.
305306
/// @param pointer Pointer to the main table.
306307
JSWASM static void retain(void *pointer);
307-
308+
308309
/// @brief Decrease the retain count by 1.
309310
/// @param pointer Pointer to the main table.
310311
JSWASM static void release(void *pointer);
311-
312+
312313
/// @brief Sets completed to 1.
313314
/// @param pointer Pointer to the main table.
314315
JSWASM static void complete(void *pointer);
315-
316+
316317
/// @brief Set size.
317318
/// @param pointer Pointer to the main table.
318319
/// @param size For compressed (not decoded) audio data: the total payload size in bytes. For raw 16-bit PCM audio: the total duration in frames. Set to 0 if unknown at the beginning (eg. progressive download). Set it at any point later if it gets known.
319320
JSWASM static void setSize(void *pointer, unsigned int size);
320-
321+
321322
/// @return Returns with the size.
322323
/// @param pointer Pointer to the main table.
323324
JSWASM static unsigned int getSize(void *pointer);
324-
325+
325326
/// @return Returns with the sample rate.
326327
/// @param pointer Pointer to the main table.
327328
JSWASM static unsigned int getSamplerate(void *pointer);
328-
329+
329330
/// @brief Adds data.
330331
/// @param table Pointer to the main table.
331332
/// @param payload Pointer to the payload. Should be allocated with malloc() (NOT new or _aligned_malloc).

0 commit comments

Comments
 (0)