summaryrefslogtreecommitdiffstats
path: root/mpvcore/command.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-09-15 05:03:37 +0200
committerwm4 <wm4@nowhere>2013-09-15 05:03:55 +0200
commit884c179177063ad81cf7a7242c01767f46cd1cf8 (patch)
treeb7f1c8b896541594eff6f59c36a97a65decdca3f /mpvcore/command.c
parentaa43405020e2e710b8b431633b6750e92897c6b9 (diff)
downloadmpv-884c179177063ad81cf7a7242c01767f46cd1cf8.tar.bz2
mpv-884c179177063ad81cf7a7242c01767f46cd1cf8.tar.xz
mplayer: attempt to skip playlist entries which can't be played
This is for situations when repeated attempts at playing a playlist entry failed, and playlist navigation becomes impossible due to that. For example, it wasn't possible to skip backwards past an unplayable playlist entry: mpv file1.mkv doesntexist.mkv file3.mkv You couldn't skip back to file1.mkv from file3.mkv. When running a single "playlist_prev" command, doesntexist.mkv would be played, which would fail to load. As reaction to the failure to load it, the next file would be played, which is file3.mkv. To make this even worse, the file could successfully load, but run only for a split second. So just loading successfully isn't good enough. Attempt to solve this by marking problematic playlist entries as failed, and by having playlist_prev skip past such playlist entries. We define failure as not being able to play more than 3 seconds (or failing to initialize to begin with). (The 3 seconds are in real time, not file duration.) "playlist_prev force" still exhibits the old behavior. Additionally, use the same mechanism to prevent pointless infinite reloading if none of the files on the playlist exist. (See github issue All in all, this is a heuristic, and later adjustments might be necessary. Note: forward skips (playlist_next) are not affected at all. (Except for the interaction with --loop.)
Diffstat (limited to 'mpvcore/command.c')
-rw-r--r--mpvcore/command.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mpvcore/command.c b/mpvcore/command.c
index b3a1b7a360..df78f59d4b 100644
--- a/mpvcore/command.c
+++ b/mpvcore/command.c
@@ -2295,7 +2295,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
int dir = cmd->id == MP_CMD_PLAYLIST_PREV ? -1 : +1;
int force = cmd->args[0].v.i;
- struct playlist_entry *e = mp_next_file(mpctx, dir);
+ struct playlist_entry *e = mp_next_file(mpctx, dir, force);
if (!e && !force)
break;
mpctx->playlist->current = e;