| @@ -18,6 +18,7 @@ · 17 unmodified lines |
| 18 | /*#define MINIMP3_SEEK_IDX_LINEAR_SEARCH*/ /* define to use linear index search instead of binary search on seek */ | 18 | /*#define MINIMP3_SEEK_IDX_LINEAR_SEARCH*/ /* define to use linear index search instead of binary search on seek */ |
| 19 | #define MINIMP3_IO_SIZE (128*1024) /* io buffer size for streaming functions, must be greater than MINIMP3_BUF_SIZE */ | 19 | #define MINIMP3_IO_SIZE (128*1024) /* io buffer size for streaming functions, must be greater than MINIMP3_BUF_SIZE */ |
| 20 | #define MINIMP3_BUF_SIZE (16*1024) /* buffer which can hold minimum 10 consecutive mp3 frames (~16KB) worst case */ | 20 | #define MINIMP3_BUF_SIZE (16*1024) /* buffer which can hold minimum 10 consecutive mp3 frames (~16KB) worst case */ |
| | 21 | /*#define MINIMP3_SCAN_LIMIT (256*1024)*/ /* how many bytes will be scanned to search first valid mp3 frame, to prevent stall on large non-mp3 files */ |
| 21 | #define MINIMP3_ENABLE_RING 0 /* WIP enable hardware magic ring buffer if available, to make less input buffer memmove(s) in callback IO mode */ | 22 | #define MINIMP3_ENABLE_RING 0 /* WIP enable hardware magic ring buffer if available, to make less input buffer memmove(s) in callback IO mode */ |
| 22 | | 23 | |
| 23 | /* return error codes */ | 24 | /* return error codes */ |
| @@ -845,7 +846,11 @@ do_exit: · 821 unmodified lines |
| 845 | size_t mp3dec_ex_read(mp3dec_ex_t *dec, mp3d_sample_t *buf, size_t samples) | 846 | size_t mp3dec_ex_read(mp3dec_ex_t *dec, mp3d_sample_t *buf, size_t samples) |
| 846 | { | 847 | { |
| 847 | if (!dec || !buf) | 848 | if (!dec || !buf) |
| 848 | return MP3D_E_PARAM; | 849 | { |
| | 850 | if (dec) |
| | 851 | dec->last_error = MP3D_E_PARAM; |
| | 852 | return 0; |
| | 853 | } |
| 849 | uint64_t end_offset = dec->end_offset ? dec->end_offset : dec->file.size; | 854 | uint64_t end_offset = dec->end_offset ? dec->end_offset : dec->file.size; |
| 850 | size_t samples_requested = samples; | 855 | size_t samples_requested = samples; |
| 851 | int eof = 0; | 856 | int eof = 0; |