diff options
author | wm4 <wm4@nowhere> | 2014-10-30 23:54:06 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-10-31 00:51:52 +0100 |
commit | 6ddd2b8e0348e311eb883511c5cc4d5598bda086 (patch) | |
tree | 8122ae139a5656d8c2891a11a676edb3974b4d2c /player/core.h | |
parent | 733936f376bd69b6d7743a94152d740d16679b36 (diff) | |
download | mpv-6ddd2b8e0348e311eb883511c5cc4d5598bda086.tar.bz2 mpv-6ddd2b8e0348e311eb883511c5cc4d5598bda086.tar.xz |
player: improve exit message in some scenarios
If you played e.g. an audio-only file and something bad happened that
interrupted playback, the exit message could say "No files played".
This was awkward, so show a different message in this case.
Also overhaul how the exit status is reported in order to make this
easier. This includes things such as not reporting a playback error
when loading playlists (playlists contain no video or audio, which
was considered an error).
Not sure if I'm happy with this, but for now it seems like a slight
improvement.
Diffstat (limited to 'player/core.h')
-rw-r--r-- | player/core.h | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/player/core.h b/player/core.h index 32c6b45db6..631e5c75e0 100644 --- a/player/core.h +++ b/player/core.h @@ -41,15 +41,6 @@ enum stop_play_reason { PT_ERROR, // play next playlist entry (due to an error) }; -enum exit_reason { - EXIT_NONE, - EXIT_QUIT, - EXIT_PLAYED, - EXIT_ERROR, - EXIT_NOTPLAYED, - EXIT_SOMENOTPLAYED -}; - struct timeline_part { double start; double source_start; @@ -182,14 +173,19 @@ typedef struct MPContext { char *stream_open_filename; enum stop_play_reason stop_play; bool playback_initialized; // playloop can be run/is running + int error_playing; // Return code to use with PT_QUIT - enum exit_reason quit_player_rc; int quit_custom_rc; bool has_quit_custom_rc; - int error_playing; char **resume_defaults; + // Global file statistics + int files_played; // played without issues (even if stopped by user) + int files_errored; // played, but errors happened at one point + int files_broken; // couldn't be played at all + + // Current file statistics int64_t shown_vframes, shown_aframes; struct stream *stream; // stream that was initially opened |