diff options
author | wm4 <wm4@nowhere> | 2016-08-17 22:45:44 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-08-17 22:46:48 +0200 |
commit | f5bbb5aed22f9c52ce078522dc3da6a9403e8a9d (patch) | |
tree | a37070ada1f37719257197e1551074ded8b38513 /options | |
parent | 07f8b647547cadb61d0677200faeaf1498b8377e (diff) | |
download | mpv-f5bbb5aed22f9c52ce078522dc3da6a9403e8a9d.tar.bz2 mpv-f5bbb5aed22f9c52ce078522dc3da6a9403e8a9d.tar.xz |
player: add option to control duration of image display
The --image-display-duration option controls how long an image is
displayed. It's also possible to display the image forever (until manual
user interaction stops playback).
With this, the core drops the old method to "drain" video (i.e. waiting
for the last frame duration on end of playback). Instead, we reuse
MPContext.time_frame. The old mechanism was disabled for non-images
anyway.
Fixes #3425.
Diffstat (limited to 'options')
-rw-r--r-- | options/options.c | 4 | ||||
-rw-r--r-- | options/options.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/options/options.c b/options/options.c index 9e3e70385e..1a8ecaca2f 100644 --- a/options/options.c +++ b/options/options.c @@ -25,6 +25,7 @@ #include <stddef.h> #include <sys/types.h> #include <limits.h> +#include <math.h> #include "config.h" @@ -214,6 +215,8 @@ const m_option_t mp_opts[] = { ({"no", 0}, {"yes", 1}, {"always", 2})), + OPT_DOUBLE("image-display-duration", image_display_duration, + M_OPT_RANGE, 0, INFINITY), OPT_CHOICE("index", index_mode, 0, ({"default", 1}, {"recreate", 0})), @@ -796,6 +799,7 @@ const struct MPOpts mp_default_opts = { .play_frames = -1, .rebase_start_time = 1, .keep_open = 0, + .image_display_duration = 1.0, .stream_id = { { [STREAM_AUDIO] = -1, [STREAM_VIDEO] = -1, [STREAM_SUB] = -1, }, diff --git a/options/options.h b/options/options.h index 4de4a831bb..263caaa8de 100644 --- a/options/options.h +++ b/options/options.h @@ -190,6 +190,7 @@ typedef struct MPOpts { int ignore_path_in_watch_later_config; int pause; int keep_open; + double image_display_duration; char *lavfi_complex; int stream_id[2][STREAM_TYPE_COUNT]; int stream_id_ff[STREAM_TYPE_COUNT]; |