Codebase list squeezelite / 8245897
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 10 years ago
4 changed file(s) with 24 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
224224 if (codecs[i] && codecs[i]->id == format) {
225225
226226 if (codec && codec != codecs[i]) {
227 LOG_INFO("closing codec");
227 LOG_INFO("closing codec: '%c'", codec->id);
228228 codec->close();
229229 }
230230
278278 rates[i] = last = largest;
279279 }
280280 } 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
282282 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;
287288 int i, j;
289 if (max < min) { tmp = max; max = min; min = tmp; }
288290 rates[0] = max;
289291 for (i = 0, j = 1; i < MAX_SUPPORTED_SAMPLERATES; ++i) {
290292 if (ref[i] < rates[j-1] && ref[i] >= min) {
1919
2020 // make may define: PORTAUDIO, SELFPIPE, RESAMPLE, VISEXPORT, DSD, LINKALL to influence build
2121
22 #define VERSION "v1.4-beta1"
22 #define VERSION "v1.4"
2323
2424 // build detection
2525 #if defined(linux)
3030
3131 struct vorbis {
3232 OggVorbis_File *vf;
33 bool opened;
3334 #if !LINKALL
3435 // vorbis symbols to be dynamically loaded - from either vorbisfile or vorbisidec (tremor) version of library
3536 vorbis_info *(* ov_info)(OggVorbis_File *vf, int link);
141142 UNLOCK_S;
142143 return DECODE_COMPLETE;
143144 }
145 v->opened = true;
144146
145147 info = OV(v, info, v->vf, -1);
146148
244246 static void vorbis_open(u8_t size, u8_t rate, u8_t chan, u8_t endianness) {
245247 if (!v->vf) {
246248 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);
247250 } 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) {
248260 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 }
254263 free(v->vf);
255264 v->vf = NULL;
256265 }
305314 }
306315
307316 v->vf = NULL;
317 v->opened = false;
308318
309319 if (!load_vorbis()) {
310320 return NULL;