mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-27 05:10:20 +00:00
command: rename vo-missed-frame-count property
"Missed" implies the frame was dropped, but what really happens is that the following frame will be shown later than intended (due to the current frame skipping a vsync). (As of this commit, this property is still inactive and always returns 0. See git blame for details.)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
10
player/osd.c
10
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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user