release 1.4
- bump version to 1.4
- fix crash with vorbis codec clearing before opening
- fix parsing of -r option min-max
Adrian Smith
9 years ago
224 | 224 |
if (codecs[i] && codecs[i]->id == format) {
|
225 | 225 |
|
226 | 226 |
if (codec && codec != codecs[i]) {
|
227 | |
LOG_INFO("closing codec");
|
|
227 |
LOG_INFO("closing codec: '%c'", codec->id);
|
228 | 228 |
codec->close();
|
229 | 229 |
}
|
230 | 230 |
|
278 | 278 |
rates[i] = last = largest;
|
279 | 279 |
}
|
280 | 280 |
} else {
|
281 | |
// optstr is <max>-<min> or <max>, extract rates from test rates within this range
|
|
281 |
// optstr is <min>-<max> or <max>, extract rates from test rates within this range
|
282 | 282 |
unsigned ref[] TEST_RATES;
|
283 | |
char *maxstr = next_param(optarg, '-');
|
284 | |
char *minstr = next_param(NULL, '-');
|
285 | |
unsigned max = maxstr ? atoi(maxstr) : ref[0];
|
286 | |
unsigned min = minstr ? atoi(minstr) : 0;
|
|
283 |
char *str1 = next_param(optarg, '-');
|
|
284 |
char *str2 = next_param(NULL, '-');
|
|
285 |
unsigned max = str2 ? atoi(str2) : (str1 ? atoi(str1) : ref[0]);
|
|
286 |
unsigned min = str1 && str2 ? atoi(str1) : 0;
|
|
287 |
unsigned tmp;
|
287 | 288 |
int i, j;
|
|
289 |
if (max < min) { tmp = max; max = min; min = tmp; }
|
288 | 290 |
rates[0] = max;
|
289 | 291 |
for (i = 0, j = 1; i < MAX_SUPPORTED_SAMPLERATES; ++i) {
|
290 | 292 |
if (ref[i] < rates[j-1] && ref[i] >= min) {
|
19 | 19 |
|
20 | 20 |
// make may define: PORTAUDIO, SELFPIPE, RESAMPLE, VISEXPORT, DSD, LINKALL to influence build
|
21 | 21 |
|
22 | |
#define VERSION "v1.4-beta1"
|
|
22 |
#define VERSION "v1.4"
|
23 | 23 |
|
24 | 24 |
// build detection
|
25 | 25 |
#if defined(linux)
|
30 | 30 |
|
31 | 31 |
struct vorbis {
|
32 | 32 |
OggVorbis_File *vf;
|
|
33 |
bool opened;
|
33 | 34 |
#if !LINKALL
|
34 | 35 |
// vorbis symbols to be dynamically loaded - from either vorbisfile or vorbisidec (tremor) version of library
|
35 | 36 |
vorbis_info *(* ov_info)(OggVorbis_File *vf, int link);
|
|
141 | 142 |
UNLOCK_S;
|
142 | 143 |
return DECODE_COMPLETE;
|
143 | 144 |
}
|
|
145 |
v->opened = true;
|
144 | 146 |
|
145 | 147 |
info = OV(v, info, v->vf, -1);
|
146 | 148 |
|
|
244 | 246 |
static void vorbis_open(u8_t size, u8_t rate, u8_t chan, u8_t endianness) {
|
245 | 247 |
if (!v->vf) {
|
246 | 248 |
v->vf = malloc(sizeof(OggVorbis_File) + 128); // add some padding as struct size may be larger
|
|
249 |
memset(v->vf, 0, sizeof(OggVorbis_File) + 128);
|
247 | 250 |
} else {
|
|
251 |
if (v->opened) {
|
|
252 |
OV(v, clear, v->vf);
|
|
253 |
v->opened = false;
|
|
254 |
}
|
|
255 |
}
|
|
256 |
}
|
|
257 |
|
|
258 |
static void vorbis_close(void) {
|
|
259 |
if (v->opened) {
|
248 | 260 |
OV(v, clear, v->vf);
|
249 | |
}
|
250 | |
}
|
251 | |
|
252 | |
static void vorbis_close(void) {
|
253 | |
OV(v, clear, v->vf);
|
|
261 |
v->opened = false;
|
|
262 |
}
|
254 | 263 |
free(v->vf);
|
255 | 264 |
v->vf = NULL;
|
256 | 265 |
}
|
|
305 | 314 |
}
|
306 | 315 |
|
307 | 316 |
v->vf = NULL;
|
|
317 |
v->opened = false;
|
308 | 318 |
|
309 | 319 |
if (!load_vorbis()) {
|
310 | 320 |
return NULL;
|