static struct track_info *cmus_get_next_from_main_thread(void) { struct track_info *ti = play_queue_remove(); if (!ti) ti = play_library ? lib_goto_next() : pl_goto_next(); return ti; }
void cmus_next(void) { struct track_info *info; editable_lock(); info = play_queue_remove(); if (info == NULL) { if (play_library) { info = lib_goto_next(); } else { info = pl_goto_next(); } } editable_unlock(); if (info) player_set_file(info); }