File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 1
1
ver 0.20.7 (not yet released)
2
2
* database
3
3
- simple: fix false positive directory loop detection with NFS
4
+ * enforce a reasonable minimum audio_buffer_size setting
4
5
* fix random crashes when compiled with clang
5
6
6
7
ver 0.20.6 (2017/03/10)
Original file line number Diff line number Diff line change @@ -121,6 +121,9 @@ static constexpr size_t KILOBYTE = 1024;
121
121
static constexpr size_t MEGABYTE = 1024 * KILOBYTE;
122
122
123
123
static constexpr size_t DEFAULT_BUFFER_SIZE = 4 * MEGABYTE;
124
+ static constexpr size_t MIN_BUFFER_SIZE = std::max(CHUNK_SIZE * 32 ,
125
+ 64 * KILOBYTE);
126
+
124
127
static constexpr unsigned DEFAULT_BUFFER_BEFORE_PLAY = 10 ;
125
128
126
129
#ifdef ANDROID
@@ -310,6 +313,13 @@ initialize_decoder_and_player(const ReplayGainConfig &replay_gain_config)
310
313
" positive integer, line %i" ,
311
314
param->value .c_str (), param->line );
312
315
buffer_size = tmp * KILOBYTE;
316
+
317
+ if (buffer_size < MIN_BUFFER_SIZE) {
318
+ FormatWarning (config_domain, " buffer size %lu is too small, using %lu bytes instead" ,
319
+ (unsigned long )buffer_size,
320
+ (unsigned long )MIN_BUFFER_SIZE);
321
+ buffer_size = MIN_BUFFER_SIZE;
322
+ }
313
323
} else
314
324
buffer_size = DEFAULT_BUFFER_SIZE;
315
325
You can’t perform that action at this time.
0 commit comments