diff options
author | wm4 <wm4@nowhere> | 2020-02-28 17:15:07 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-02-28 17:15:07 +0100 |
commit | 679e4108f29db061e85687af18f0e013c067f59b (patch) | |
tree | c5ade054525ba1e7832f5997ebf7f4d234bc81e2 /player/misc.c | |
parent | 85576f31a9cc25ca75ac7d265aaaf211f76a4842 (diff) | |
download | mpv-679e4108f29db061e85687af18f0e013c067f59b.tar.bz2 mpv-679e4108f29db061e85687af18f0e013c067f59b.tar.xz |
player: dumb seeking related stuff, make audio hr-seek default
Try to deal with various corner cases. But when I fix one thing, another
thing breaks. (And it's 50/50 whether I find the breakage immediately or
a few months later.) So results may vary.
The default for--hr-seek is changed to "default" (not creative enough to
find a better name). In this mode, audio seeking is exact if there is no
video, or if the video has only a single frame. This change is actually
pretty dumb, since audio frames are usually small enough that exact
seeking does not really add much. But it gets rid of some weird special
cases.
Internally, the most important change is that is_coverart and is_sparse
handling is merged. is_sparse was originally just a special case for
weird .ts streams that have the corresponding low-level flag set. The
idea is that they're pretty similar anyway, so this would reduce the
number of corner cases. But I'm not sure if this doesn't break the
original intended use case for it (I don't have a sample anyway).
This changes last-frame handling, and respects the duration of the last
frame only if audio is disabled. This is mostly "coincidental" due to
the need to make seeking past EOF trigger player exit, and is caused by
setting STATUS_EOF early. On the other hand, this might have been this
way before (see removed chunk close to it).
Diffstat (limited to 'player/misc.c')
-rw-r--r-- | player/misc.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/player/misc.c b/player/misc.c index f6a63ec7ef..4246c1c6f9 100644 --- a/player/misc.c +++ b/player/misc.c @@ -301,3 +301,16 @@ void merge_playlist_files(struct playlist *pl) playlist_add_file(pl, edl); talloc_free(edl); } + +const char *mp_status_str(enum playback_status st) +{ + switch (st) { + case STATUS_SYNCING: return "syncing"; + case STATUS_FILLING: return "filling"; + case STATUS_READY: return "ready"; + case STATUS_PLAYING: return "playing"; + case STATUS_DRAINING: return "draining"; + case STATUS_EOF: return "eof"; + default: return "bug"; + } +} |