summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--DOCS/man/input.rst5
-rw-r--r--DOCS/man/mpv.rst12
-rw-r--r--player/command.c10
-rw-r--r--player/osd.c10
-rw-r--r--video/out/vo.c8
-rw-r--r--video/out/vo.h2
6 files changed, 22 insertions, 25 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index 108c7a0de2..50ac4dbfbf 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -921,6 +921,11 @@ Property list
(which can happen especially with bad source timestamps). For example,
using the ``display-desync`` mode should never change this value from 0.
+``vo-delayed-frame-count``
+ Estimated number of frames delayed due to external circumstances in
+ display-sync mode. Note that in general, mpv has to guess that this is
+ happening, and the guess can be inaccurate.
+
``percent-pos`` (RW)
Position in current file (0-100). The advantage over using this instead of
calculating it out of other properties is that it properly falls back to
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst
index b8bd266aa4..3e45f93072 100644
--- a/DOCS/man/mpv.rst
+++ b/DOCS/man/mpv.rst
@@ -566,13 +566,11 @@ listed.
this will indicate a problem. (``total-avsync-change`` property.)
- Encoding state in ``{...}``, only shown in encoding mode.
- Display sync state. If display sync is active (``display-sync-active``
- property), this shows ``DS: +0.02598%``, where the number is the speed change
- factor applied to audio to achieve sync to display, expressed in percent
- deviation from 1.0 (``audio-speed-correction`` property). In sync modes which
- don't resample, this will always be ``+0.00000%``.
-- Missed frames, e.g. ``Missed: 4``. (``vo-missed-frame-count`` property.) Shows
- up in display sync mode only. This is incremented each time a frame took
- longer to display than intended.
+ property), this shows ``DS: 12/13``, where the first number is the number of
+ frames where a vsync was intentionally added or removed
+ (``mistimed-frame-count``), and the second number of estimated number of vsyncs
+ which took too long (``vo-delayed-frame-count`` property). The latter is a
+ heuristic, as it's generally not possible to determine this with certainty.
- Dropped frames, e.g. ``Dropped: 4``. Shows up only if the count is not 0. Can
grow if the video framerate is higher than that of the display, or if video
rendering is too slow. Also can be incremented on "hiccups" and when the video
diff --git a/player/command.c b/player/command.c
index 6473de4af9..db368df079 100644
--- a/player/command.c
+++ b/player/command.c
@@ -583,14 +583,14 @@ static int mp_property_vo_drop_frame_count(void *ctx, struct m_property *prop,
return m_property_int_ro(action, arg, vo_get_drop_count(mpctx->video_out));
}
-static int mp_property_vo_missed_frame_count(void *ctx, struct m_property *prop,
- int action, void *arg)
+static int mp_property_vo_delayed_frame_count(void *ctx, struct m_property *prop,
+ int action, void *arg)
{
MPContext *mpctx = ctx;
if (!mpctx->d_video)
return M_PROPERTY_UNAVAILABLE;
- return m_property_int_ro(action, arg, vo_get_missed_count(mpctx->video_out));
+ return m_property_int_ro(action, arg, vo_get_delayed_count(mpctx->video_out));
}
/// Current position in percent (RW)
@@ -3395,7 +3395,7 @@ static const struct m_property mp_properties[] = {
{"drop-frame-count", mp_property_drop_frame_cnt},
{"mistimed-frame-count", mp_property_mistimed_frame_count},
{"vo-drop-frame-count", mp_property_vo_drop_frame_count},
- {"vo-missed-frame-count", mp_property_vo_missed_frame_count},
+ {"vo-delayed-frame-count", mp_property_vo_delayed_frame_count},
{"percent-pos", mp_property_percent_pos},
{"time-start", mp_property_time_start},
{"time-pos", mp_property_time_pos},
@@ -3612,7 +3612,7 @@ static const char *const *const mp_event_property_change[] = {
"percent-pos", "time-remaining", "playtime-remaining", "playback-time",
"estimated-vf-fps", "drop-frame-count", "vo-drop-frame-count",
"total-avsync-change", "audio-speed-correction", "video-speed-correction",
- "vo-missed-frame-count", "mistimed-frame-count"),
+ "vo-delayed-frame-count", "mistimed-frame-count"),
E(MPV_EVENT_VIDEO_RECONFIG, "video-out-params", "video-params",
"video-format", "video-codec", "video-bitrate", "dwidth", "dheight",
"width", "height", "fps", "aspect", "vo-configured", "current-vo",
diff --git a/player/osd.c b/player/osd.c
index da14f8ff2b..596386ebae 100644
--- a/player/osd.c
+++ b/player/osd.c
@@ -234,14 +234,8 @@ static void print_status(struct MPContext *mpctx)
// VO stats
if (mpctx->d_video) {
if (mpctx->display_sync_active) {
- char *f =
- mp_property_expand_string(mpctx, "${audio-speed-correction}");
- if (f)
- saddf(&line, " DS: %s", f);
- talloc_free(f);
- int64_t m = vo_get_missed_count(mpctx->video_out);
- if (m > 0)
- saddf(&line, " Missed: %"PRId64, m);
+ saddf(&line, " DS: %d/%"PRId64, mpctx->mistimed_frames_total,
+ vo_get_delayed_count(mpctx->video_out));
}
int64_t c = vo_get_drop_count(mpctx->video_out);
if (c > 0 || mpctx->dropped_frames_total > 0) {
diff --git a/video/out/vo.c b/video/out/vo.c
index 35c583b35f..81537e80d9 100644
--- a/video/out/vo.c
+++ b/video/out/vo.c
@@ -144,7 +144,7 @@ struct vo_internal {
int64_t flip_queue_offset; // queue flip events at most this much in advance
- int64_t missed_count;
+ int64_t delayed_count;
int64_t drop_count;
bool dropped_frame; // the previous frame was dropped
@@ -423,7 +423,7 @@ static void forget_frames(struct vo *vo)
in->hasframe = false;
in->hasframe_rendered = false;
in->drop_count = 0;
- in->missed_count = 0;
+ in->delayed_count = 0;
talloc_free(in->frame_queued);
in->frame_queued = NULL;
// don't unref current_frame; we always want to be able to redraw it
@@ -1050,11 +1050,11 @@ int64_t vo_get_next_frame_start_time(struct vo *vo)
return res;
}
-int64_t vo_get_missed_count(struct vo *vo)
+int64_t vo_get_delayed_count(struct vo *vo)
{
struct vo_internal *in = vo->in;
pthread_mutex_lock(&in->lock);
- int64_t res = vo->in->missed_count;
+ int64_t res = vo->in->delayed_count;
pthread_mutex_unlock(&in->lock);
return res;
}
diff --git a/video/out/vo.h b/video/out/vo.h
index 213b287ab2..c7bcccd778 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -332,7 +332,7 @@ void vo_destroy(struct vo *vo);
void vo_set_paused(struct vo *vo, bool paused);
int64_t vo_get_drop_count(struct vo *vo);
void vo_increment_drop_count(struct vo *vo, int64_t n);
-int64_t vo_get_missed_count(struct vo *vo);
+int64_t vo_get_delayed_count(struct vo *vo);
void vo_query_formats(struct vo *vo, uint8_t *list);
void vo_event(struct vo *vo, int event);
int vo_query_and_reset_events(struct vo *vo, int events);