Merge pull request #107 from chme/mpdfixes

Fix segfault when loading playlists
This commit is contained in:
ejurgensen 2015-02-23 21:28:54 +01:00
commit 83b0109a70
3 changed files with 10 additions and 9 deletions

View File

@ -239,7 +239,7 @@ static const ssize_t dbpli_cols_map[] =
dbpli_offsetof(path), dbpli_offsetof(path),
dbpli_offsetof(index), dbpli_offsetof(index),
dbpli_offsetof(special_id), dbpli_offsetof(special_id),
dbmfi_offsetof(virtual_path), dbpli_offsetof(virtual_path),
/* items is computed on the fly */ /* items is computed on the fly */
}; };
@ -815,7 +815,7 @@ db_purge_cruft(time_t ref)
void void
db_purge_all(void) db_purge_all(void)
{ {
char *queries[6] = char *queries[5] =
{ {
"DELETE FROM inotify;", "DELETE FROM inotify;",
"DELETE FROM playlistitems;", "DELETE FROM playlistitems;",

View File

@ -194,6 +194,7 @@ struct db_playlist_info {
char *path; char *path;
char *index; char *index;
char *special_id; char *special_id;
char *virtual_path;
}; };
#define dbpli_offsetof(field) offsetof(struct db_playlist_info, field) #define dbpli_offsetof(field) offsetof(struct db_playlist_info, field)

View File

@ -2138,7 +2138,7 @@ filescanner_init(void)
} }
event_set(&cmdev, cmd_pipe[0], EV_READ, command_cb, NULL); event_set(&cmdev, cmd_pipe[0], EV_READ, command_cb, NULL);
event_base_set(evbase_scan, &exitev); event_base_set(evbase_scan, &cmdev);
event_add(&cmdev, NULL); event_add(&cmdev, NULL);
ret = pthread_create(&tid_scan, NULL, filescanner, NULL); ret = pthread_create(&tid_scan, NULL, filescanner, NULL);