command: send property-change event on playlist change

This commit is contained in:
Alessandro Ghedini 2014-11-08 23:03:04 +01:00 committed by wm4
parent e440352313
commit 5f175b0bdc
2 changed files with 6 additions and 0 deletions

View File

@ -4147,6 +4147,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
mp_write_watch_later_conf(mpctx);
mp_set_playlist_entry(mpctx, entry);
}
mp_notify_property(mpctx, "playlist");
break;
}
@ -4165,6 +4166,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
mp_check_playlist_resume(mpctx, mpctx->playlist);
mp_set_playlist_entry(mpctx, e ? e : mpctx->playlist->first);
}
mp_notify_property(mpctx, "playlist");
} else {
MP_ERR(mpctx, "Unable to load playlist %s.\n", filename);
return -1;
@ -4185,6 +4187,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
}
playlist_remove(mpctx->playlist, e);
}
mp_notify_property(mpctx, "playlist");
break;
}
@ -4199,6 +4202,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
if (mpctx->playlist->current == e)
mpctx->stop_play = PT_CURRENT_ENTRY;
playlist_remove(mpctx->playlist, e);
mp_notify_property(mpctx, "playlist");
break;
}
@ -4210,6 +4214,7 @@ int run_command(MPContext *mpctx, mp_cmd_t *cmd)
if (!e1)
return -1;
playlist_move(mpctx->playlist, e1, e2);
mp_notify_property(mpctx, "playlist");
break;
}

View File

@ -1001,6 +1001,7 @@ goto_reopen_demuxer: ;
for (struct playlist_entry *e = pl->first; e; e = e->next)
e->stream_flags |= entry_stream_flags;
transfer_playlist(mpctx, pl);
mp_notify_property(mpctx, "playlist");
mpctx->error_playing = 1;
goto terminate_playback;
}