return write_all(server_socket, buf, 8);
}
-/* Never fails if arg == NULL */
static int activate_mood_or_playlist(const char *arg, int *num_admissible,
char **errmsg)
{
int ret;
if (!arg) {
- ret = change_current_mood(NULL, NULL); /* always successful */
mode = PLAY_MODE_MOOD;
+ ret = change_current_mood(NULL, errmsg);
+ if (ret < 0) {
+ if (num_admissible)
+ *num_admissible = 0;
+ return ret;
+ }
} else {
if (!strncmp(arg, "p/", 2)) {
ret = playlist_open(arg + 2);
{
int ret = activate_mood_or_playlist(arg, NULL, NULL);
if (ret < 0) {
- assert(arg);
PARA_WARNING_LOG("could not activate %s: %s\n", arg,
para_strerror(-ret));
- activate_mood_or_playlist(NULL, NULL, NULL);
+ if (arg)
+ activate_mood_or_playlist(NULL, NULL, NULL);
}
}
*
* If there is already an open mood, it will be closed first.
*
- * \return Positive on success, negative on errors. Loading the dummy mood
- * always succeeds.
+ * \return Positive on success, negative on errors.
*
* \sa struct \ref afs_info::last_played, \ref mp_eval_row().
*/