player: relax assertion on mp_set_playlist_entry

This assertion crashed when e was NULL, which can happen when using
force.
This commit is contained in:
Niklas Haas 2015-03-23 04:50:51 +01:00 committed by wm4
parent 8c43e12b20
commit 4bcd6ec41d
1 changed files with 1 additions and 1 deletions

View File

@ -1419,7 +1419,7 @@ void mp_play_files(struct MPContext *mpctx)
// e must be on the mpctx->playlist. // e must be on the mpctx->playlist.
void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e) void mp_set_playlist_entry(struct MPContext *mpctx, struct playlist_entry *e)
{ {
assert(playlist_entry_to_index(mpctx->playlist, e) >= 0); assert(!e || playlist_entry_to_index(mpctx->playlist, e) >= 0);
mpctx->playlist->current = e; mpctx->playlist->current = e;
mpctx->playlist->current_was_replaced = false; mpctx->playlist->current_was_replaced = false;
mpctx->stop_play = PT_CURRENT_ENTRY; mpctx->stop_play = PT_CURRENT_ENTRY;