Commit Graph

4 Commits

Author SHA1 Message Date
wm4 2c6a3cb1f2 mplayer: fix looping of very short files
Commit 884c179 attempted to make it possible to skip backwards through
the playlist, even for files which fail to intitialize, or play for a
very short time. This was also used to prevent mpv from looping forever
and doing nothing if --loop=inf is used, and no file in the playlist is
playable.

This broke looping of very short files, because mpv was assuming that
this case happened. But there are legitimate use cases.

Fix this by making the looping case special. Instead of checking whether
playback was "very short", check whether something could be decoded and
displayed/played. If yes, allow looping.
2013-09-29 21:10:45 +02:00
wm4 884c179177 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.)
2013-09-15 05:03:55 +02:00
Stefano Pigozzi 406241005e core: move contents to mpvcore (2/2)
Followup commit. Fixes all the files references.
2013-08-06 22:52:31 +02:00
Stefano Pigozzi bc27f946c2 core: move contents to mpvcore (1/2)
core is used in many unix systems for core dumps. For that reason some tools
work under the assumption that the file is indeed a core dump (for example
autoconf does this).

This commit just renames the files. The following one will change all the
includes to fix compilation. This is done this way because git has a easier
time tracing file changes if there is a pure rename commit.
2013-08-06 22:48:47 +02:00