1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-21 06:14:32 +00:00
mpv/common
Dudemanguy 034f75dacd loadfile: fix an old wonky playlist heuristic
2c6a3cb1f2 originally added this struct
member and then 1be863afdb later added
some more logic to loadfile that uses this. There's been more changes
since then of course, but bits using playback_short and playback_start
have mostly stayed the same. It's a bit strange it's worked this way for
so long since it makes an assumption on how long files should be and
leads to weird, broken behavior on playlists with shorter videos. The
main reason for playlist_short, as far as I can tell, is to deal with
some fringe cases with short videos and trying to go back in the
playlist. More specifically, if you use --loop=inf on a very short video
(say less than 1 second) and try to go back in the playlist, you won't
be able to without any of this special logic that deals with it. But the
current approach has several side effects like going back multiple items
in the playlist instead of just one if the video is less than one
second. This is just bad so delete everything related to playlist_short
and playlist_start.

Instead, let's handle this by keeping track of playlist-prev attempts.
Going forward in the playlist doesn't require any special handling since
a bad/broken file will just advance to the next one. So it's only going
backwards that requires some special consideration. If we're going
backwards and the user isn't using force, then mark the playlist entry
with a special flag. If the file loads successfully in
play_current_file, we can just clear the flag and not worry about it.
However if there's a failure, then we set a bool telling
play_current_file that it should go back one more item in the playlist
if possible and try again. This way, we avoid the previously mentioned
--loop=inf edgecase and the user can still attempt to retry previously
failed items in the playlist (like a url or such).

Fixes #6576, fixes #12548.
2023-10-05 17:09:43 +02:00
..
av_common.c common/av_common: clean up mp_lavc_set_extradata 2023-03-14 23:59:47 +02:00
av_common.h common/av_common: clean up mp_lavc_set_extradata 2023-03-14 23:59:47 +02:00
av_log.c common/av_log: move general FFmpeg version before library versions 2022-11-15 21:41:22 +02:00
av_log.h
codecs.c
codecs.h
common.c vo: add --video-crop 2023-08-31 17:37:42 +00:00
common.h vo: add --video-crop 2023-08-31 17:37:42 +00:00
encode_lavc.c options: remove a few options marked with .deprecation_message 2023-09-21 16:06:29 +00:00
encode_lavc.h options: remove a few options marked with .deprecation_message 2023-09-21 16:06:29 +00:00
encode.h options: remove a few options marked with .deprecation_message 2023-09-21 16:06:29 +00:00
global.h path: simplify "cache" and "state" fallback 2023-05-21 20:11:24 +02:00
meson.build build: remove version.py 2023-08-02 18:51:13 +00:00
msg_control.h various: add missing include in header flles 2023-09-21 14:40:11 +00:00
msg.c msg: use nanosecond precision 2023-09-29 18:20:30 -05:00
msg.h msg: add function to reduce log level 2020-05-10 16:40:26 +02:00
playlist.c playlist: remove unused code to track redirects 2023-08-28 18:31:17 +00:00
playlist.h loadfile: fix an old wonky playlist heuristic 2023-10-05 17:09:43 +02:00
recorder.c recorder: fix a couple of memory leaks 2023-09-26 22:09:15 +00:00
recorder.h recorder: add support for attachments (fonts) 2021-07-08 12:44:06 +03:00
stats.c win32/pthread: define _POSIX_TIMERS to notify they are not supported 2023-09-29 20:48:58 +00:00
stats.h
tags.c
tags.h
version.c version: move NO_BUILD_TIMESTAMPS check to version.h.in 2023-08-02 18:51:13 +00:00
version.h.in version: move NO_BUILD_TIMESTAMPS check to version.h.in 2023-08-02 18:51:13 +00:00