diff options
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/dec_video.c | 7 | ||||
-rw-r--r-- | libmpcodecs/vf.h | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_ass.c | 6 |
3 files changed, 13 insertions, 3 deletions
diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index 89c2b52de4..be152f85fc 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -383,7 +383,12 @@ if(!mpi || drop_frame) return 0; // error / skipped frame //vo_draw_image(video_out,mpi); vf=sh_video->vfilter; ret = vf->put_image(vf,mpi, pts); // apply video filters and call the leaf vo/ve -if(ret>0) vf->control(vf,VFCTRL_DRAW_OSD,NULL); +if(ret>0) { + vf->control(vf,VFCTRL_DRAW_OSD,NULL); +#ifdef USE_ASS + vf->control(vf,VFCTRL_DRAW_EOSD,NULL); +#endif +} t2=GetTimer()-t2; tt=t2*0.000001f; diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h index cb6839d571..f3f46d1496 100644 --- a/libmpcodecs/vf.h +++ b/libmpcodecs/vf.h @@ -77,7 +77,8 @@ typedef struct vf_seteq_s #define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */ #define VFCTRL_FLUSH_FRAMES 13 /* For encoding - flush delayed frames */ #define VFCTRL_SCREENSHOT 14 /* Make a screenshot */ -#define VFCTRL_EOSD 15 /* Select EOSD renderer */ +#define VFCTRL_INIT_EOSD 15 /* Select EOSD renderer */ +#define VFCTRL_DRAW_EOSD 16 /* Render EOSD */ #include "vfcap.h" diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index f3163da5fb..6515fd37c5 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -355,9 +355,13 @@ static int query_format(struct vf_instance_s* vf, unsigned int fmt) static int control(vf_instance_t *vf, int request, void *data) { - if (request == VFCTRL_EOSD) { + switch (request) { + case VFCTRL_INIT_EOSD: vf->priv->ass_priv = ass_init(); return vf->priv->ass_priv ? CONTROL_TRUE : CONTROL_FALSE; + case VFCTRL_DRAW_EOSD: + if (vf->priv->ass_priv) return CONTROL_TRUE; + break; } return vf_next_control(vf, request, data); } |