mirror of
https://github.com/mpv-player/mpv
synced 2025-01-02 21:12:23 +00:00
dec_video: remove weird offset for VDCTRL_QUERY_UNSEEN_FRAMES
The return value of get_current_video_decoder_lag() should be the same before and after this change in all cases.
This commit is contained in:
parent
8884ac9f79
commit
281e10f05d
@ -172,10 +172,9 @@ int get_current_video_decoder_lag(sh_video_t *sh_video)
|
||||
const struct vd_functions *vd = sh_video->vd_driver;
|
||||
if (!vd)
|
||||
return -1;
|
||||
int ret = vd->control(sh_video, VDCTRL_QUERY_UNSEEN_FRAMES, NULL);
|
||||
if (ret >= 10)
|
||||
return ret - 10;
|
||||
return -1;
|
||||
int ret = -1;
|
||||
vd->control(sh_video, VDCTRL_QUERY_UNSEEN_FRAMES, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void uninit_video(sh_video_t *sh_video)
|
||||
|
@ -671,9 +671,11 @@ static int control(sh_video_t *sh, int cmd, void *arg)
|
||||
return CONTROL_TRUE;
|
||||
case VDCTRL_QUERY_UNSEEN_FRAMES:;
|
||||
int delay = avctx->has_b_frames;
|
||||
assert(delay >= 0);
|
||||
if (avctx->active_thread_type & FF_THREAD_FRAME)
|
||||
delay += avctx->thread_count - 1;
|
||||
return delay + 10;
|
||||
*(int *)arg = delay;
|
||||
return CONTROL_TRUE;
|
||||
case VDCTRL_RESET_ASPECT:
|
||||
if (ctx->vo_initialized)
|
||||
ctx->vo_initialized = false;
|
||||
|
Loading…
Reference in New Issue
Block a user