summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-24 23:15:11 +0100
committerwm4 <wm4@nowhere>2013-02-26 01:55:52 +0100
commit281e10f05d02d1afe24f644a2d8b1672113630fd (patch)
tree31ea51f383241c0fac628c87666760bd5eac7cd1 /video
parent8884ac9f793b1a76683783d346736eedfd9975c6 (diff)
downloadmpv-281e10f05d02d1afe24f644a2d8b1672113630fd.tar.bz2
mpv-281e10f05d02d1afe24f644a2d8b1672113630fd.tar.xz
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.
Diffstat (limited to 'video')
-rw-r--r--video/decode/dec_video.c7
-rw-r--r--video/decode/vd_lavc.c4
2 files changed, 6 insertions, 5 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c
index 4ee1e4cae3..9888881e26 100644
--- a/video/decode/dec_video.c
+++ b/video/decode/dec_video.c
@@ -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)
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index d0dff169f5..4959324509 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -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;