diff options
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r-- | apps/playlist_viewer.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index 54451992a7..751f1e21a7 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c @@ -362,9 +362,14 @@ static bool playlist_viewer_init(struct playlist_viewer * viewer, if (is_playing) { - /* Something is playing, use half the plugin buffer for playlist - indices */ - index_buffer_size = buffer_size / 2; + /* Something is playing, try to accommodate + * global_settings.max_files_in_playlist entries */ + index_buffer_size = playlist_get_required_bufsz(viewer->playlist, + false, global_settings.max_files_in_playlist); + + if ((unsigned)index_buffer_size >= buffer_size - MAX_PATH) + index_buffer_size = buffer_size - (MAX_PATH + 1); + index_buffer = buffer; } |