Skip to content
Myr

Merge branch 'rc/const' of https://github.com/ronnychevalier/stb into working

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sean Barrett · committed by Sean Barrett · parents 2119c17, c28e92e · Browse files · 1 file+4 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+4 added−4 removed

  • other:+4 added−4 removed

1 file+4 added−4 removed

modified:stb_vorbis.c+4 added-4 removed
210 unmodified lines
211// of callback to your code. (But if you don't support seeking, you may212// just want to go ahead and use pushdata.)213214#if !defined(STB_VORBIS_NO_STDIO) && !defined(STB_VORBIS_NO_INTEGER_CONVERSION)215extern int stb_vorbis_decode_filename(char *filename, int *channels, int *sample_rate, short **output);215extern int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output);216#endif217#if !defined(STB_VORBIS_NO_INTEGER_CONVERSION)218extern int stb_vorbis_decode_memory(unsigned char *mem, int len, int *channels, int *sample_rate, short **output);219#endif
7 unmodified lines
227// create an ogg vorbis decoder from an ogg vorbis stream in memory (note228// this must be the entire stream!). on failure, returns NULL and sets *error229230#ifndef STB_VORBIS_NO_STDIO231extern stb_vorbis * stb_vorbis_open_filename(char *filename,231extern stb_vorbis * stb_vorbis_open_filename(const char *filename,232 int *error, stb_vorbis_alloc *alloc_buffer);233// create an ogg vorbis decoder from a filename via fopen(). on failure,234// returns NULL and sets *error (possibly to VORBIS_file_open_failure).235
4769 unmodified lines
5005 fseek(file, start, SEEK_SET);5006 return stb_vorbis_open_file_section(file, close_on_free, error, alloc, len);5007}50085009stb_vorbis * stb_vorbis_open_filename(char *filename, int *error, stb_vorbis_alloc *alloc)5009stb_vorbis * stb_vorbis_open_filename(const char *filename, int *error, stb_vorbis_alloc *alloc)5010{5011 FILE *f = fopen(filename, "rb");5012 if (f) 5013 return stb_vorbis_open_file(f, TRUE, error, alloc);
246 unmodified lines
5260 return n;5261}52625263#ifndef STB_VORBIS_NO_STDIO5264int stb_vorbis_decode_filename(char *filename, int *channels, int *sample_rate, short **output)5264int stb_vorbis_decode_filename(const char *filename, int *channels, int *sample_rate, short **output)5265{5266 int data_len, offset, total, limit, error;5267 short *data;5268 stb_vorbis *v = stb_vorbis_open_filename(filename, &error, NULL);
173 unmodified lines