| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
#ifdef AUDIO_SCAN_DEBUG |
| 21 |
# define DEBUG_TRACE(...) PerlIO_printf(PerlIO_stderr(), __VA_ARGS__) |
| 22 |
#else |
| 23 |
# define DEBUG_TRACE(...) |
| 24 |
#endif |
| 25 |
|
| 26 |
#define LOG_WARN(...) warn(__VA_ARGS__) |
| 27 |
|
| 28 |
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4) |
| 29 |
# define _PACKED __attribute((packed)) |
| 30 |
#else |
| 31 |
# define _PACKED |
| 32 |
#endif |
| 33 |
|
| 34 |
#define DEFAULT_BLOCK_SIZE 4096 |
| 35 |
|
| 36 |
#ifndef _WIN32 |
| 37 |
|
| 38 |
typedef struct _GUID { |
| 39 |
uint32_t Data1; |
| 40 |
uint16_t Data2; |
| 41 |
uint16_t Data3; |
| 42 |
uint8_t Data4[8]; |
| 43 |
} _PACKED GUID; |
| 44 |
#endif |
| 45 |
|
| 46 |
|
| 47 |
#ifdef _MSC_VER |
| 48 |
#include "pinttypes.h" |
| 49 |
#else |
| 50 |
#include <inttypes.h> |
| 51 |
#endif |
| 52 |
|
| 53 |
#define HAS_GUID |
| 54 |
#include "buffer.h" |
| 55 |
|
| 56 |
|
| 57 |
#define my_hv_store(a,b,c) hv_store(a,b,strlen(b),c,0) |
| 58 |
#define my_hv_store_ent(a,b,c) hv_store_ent(a,b,c,0) |
| 59 |
#define my_hv_fetch(a,b) hv_fetch(a,b,strlen(b),0) |
| 60 |
#define my_hv_exists(a,b) hv_exists(a,b,strlen(b)) |
| 61 |
#define my_hv_exists_ent(a,b) hv_exists_ent(a,b,0) |
| 62 |
#define my_hv_delete(a,b) hv_delete(a,b,strlen(b),0) |
| 63 |
|
| 64 |
#define GET_INT32BE(b) \ |
| 65 |
(i = (b[0] << 24) | (b[1] << 16) | b[2] << 8 | b[3], b += 4, i) |
| 66 |
|
| 67 |
#define GET_INT16BE(b) \ |
| 68 |
(i = (b[0] << 8) | b[1], b += 2, i) |
| 69 |
|
| 70 |
#define CONVERT_INT32LE(b) \ |
| 71 |
(i = (b[3] << 24) | (b[2] << 16) | b[1] << 8 | b[0], i) |
| 72 |
|
| 73 |
#define CONVERT_INT16LE(b) \ |
| 74 |
(i = (b[1] << 8) | b[0], i) |
| 75 |
|
| 76 |
int _check_buf(PerlIO *infile, Buffer *buf, int size, int min_size); |
| 77 |
void _split_vorbis_comment(char* comment, HV* tags); |
| 78 |
int32_t skip_id3v2(PerlIO *infile); |
| 79 |
uint32_t _bitrate(uint32_t audio_size, uint32_t song_length_ms); |
| 80 |
off_t _file_size(PerlIO *infile); |
| 81 |
int _env_true(const char *name); |
| 82 |
int _decode_base64(char *s); |
| 83 |
HV * _decode_flac_picture(PerlIO *infile, Buffer *buf, uint32_t *pic_length); |