diff options
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_ffmpeg.c | 2 | ||||
-rw-r--r-- | libmpcodecs/dec_video.c | 8 | ||||
-rw-r--r-- | libmpcodecs/dec_video.h | 1 | ||||
-rw-r--r-- | libmpcodecs/vf.h | 1 | ||||
-rw-r--r-- | libmpcodecs/vf_ass.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vf_expand.c | 6 | ||||
-rw-r--r-- | libmpcodecs/vf_vo.c | 7 | ||||
-rw-r--r-- | libmpcodecs/vfcap.h | 2 |
8 files changed, 8 insertions, 21 deletions
diff --git a/libmpcodecs/ad_ffmpeg.c b/libmpcodecs/ad_ffmpeg.c index ae7f36b791..762c80282d 100644 --- a/libmpcodecs/ad_ffmpeg.c +++ b/libmpcodecs/ad_ffmpeg.c @@ -214,7 +214,7 @@ static void uninit(sh_audio_t *sh) AVCodecContext *lavc_context = ctx->avctx; if (lavc_context) { - if (avcodec_close(lavc_context) < 0) + if (lavc_context->codec && avcodec_close(lavc_context) < 0) mp_tmsg(MSGT_DECVIDEO, MSGL_ERR, "Could not close codec.\n"); av_freep(&lavc_context->extradata); av_freep(&lavc_context); diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index cd3083faa4..14cf029fbe 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -195,14 +195,6 @@ int set_rectangle(sh_video_t *sh_video, int param, int value) return 0; } -int redraw_osd(struct sh_video *sh_video, struct osd_state *osd) -{ - struct vf_instance *vf = sh_video->vfilter; - if (vf->control(vf, VFCTRL_REDRAW_OSD, osd) == true) - return 0; - return -1; -} - void resync_video_stream(sh_video_t *sh_video) { const struct vd_functions *vd = sh_video->vd_driver; diff --git a/libmpcodecs/dec_video.h b/libmpcodecs/dec_video.h index f7210e02c3..ab4b55bef7 100644 --- a/libmpcodecs/dec_video.h +++ b/libmpcodecs/dec_video.h @@ -44,7 +44,6 @@ struct mp_csp_details; void get_detected_video_colorspace(struct sh_video *sh, struct mp_csp_details *csp); void set_video_colorspace(struct sh_video *sh); int set_rectangle(sh_video_t *sh_video, int param, int value); -int redraw_osd(struct sh_video *sh_video, struct osd_state *osd); void resync_video_stream(sh_video_t *sh_video); void video_reset_aspect(struct sh_video *sh_video); int get_current_video_decoder_lag(sh_video_t *sh_video); diff --git a/libmpcodecs/vf.h b/libmpcodecs/vf.h index 0dac19c9f6..d97e363778 100644 --- a/libmpcodecs/vf.h +++ b/libmpcodecs/vf.h @@ -112,7 +112,6 @@ struct vf_ctrl_screenshot { /* Hack to make the OSD state object available to vf_expand and vf_ass which * access OSD/subtitle state outside of normal OSD draw time. */ #define VFCTRL_SET_OSD_OBJ 20 -#define VFCTRL_REDRAW_OSD 21 // Change user-visible OSD immediately #define VFCTRL_SET_YUV_COLORSPACE 22 // arg is struct mp_csp_details* #define VFCTRL_GET_YUV_COLORSPACE 23 // arg is struct mp_csp_details* diff --git a/libmpcodecs/vf_ass.c b/libmpcodecs/vf_ass.c index c5613ce992..a062149364 100644 --- a/libmpcodecs/vf_ass.c +++ b/libmpcodecs/vf_ass.c @@ -463,7 +463,7 @@ static int vf_open(vf_instance_t *vf, char *args) vf->control = control; vf->get_image = get_image; vf->put_image = put_image; - vf->default_caps = VFCAP_EOSD; + vf->default_caps = VFCAP_EOSD | VFCAP_EOSD_FILTER; return 1; } diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c index 95580b9f26..a640108e0e 100644 --- a/libmpcodecs/vf_expand.c +++ b/libmpcodecs/vf_expand.c @@ -452,10 +452,6 @@ static int control(struct vf_instance *vf, int request, void* data){ case VFCTRL_DRAW_OSD: if(vf->priv->osd_enabled) return CONTROL_TRUE; break; - case VFCTRL_REDRAW_OSD: - if (vf->priv->osd_enabled) - return false; - break; } #endif return vf_next_control(vf,request,data); @@ -481,6 +477,8 @@ static int vf_open(vf_instance_t *vf, char *args){ vf->priv->osd_enabled, vf->priv->aspect, vf->priv->round); + if (vf->priv->osd_enabled) + vf->default_caps = VFCAP_OSD_FILTER; return 1; } diff --git a/libmpcodecs/vf_vo.c b/libmpcodecs/vf_vo.c index 499184d37f..d673c7bcd4 100644 --- a/libmpcodecs/vf_vo.c +++ b/libmpcodecs/vf_vo.c @@ -117,8 +117,6 @@ static int control(struct vf_instance *vf, int request, void* data) if(!video_out->config_ok) return CONTROL_FALSE; // vo not configured? vo_draw_osd(video_out, data); return CONTROL_TRUE; - case VFCTRL_REDRAW_OSD: - return vo_control(video_out, VOCTRL_REDRAW_OSD, data) == true; case VFCTRL_SET_EQUALIZER: { vf_equalizer_t *eq=data; @@ -153,7 +151,6 @@ static int control(struct vf_instance *vf, int request, void* data) { struct osd_state *osd = data; mp_eosd_images_t images = {NULL, 2}; - double pts = video_out->next_pts; ASS_Renderer *renderer; double scale; if (osd->vsfilter_aspect && vf->opts->ass_vsfilter_aspect_compat) { @@ -168,7 +165,7 @@ static int control(struct vf_instance *vf, int request, void* data) if (osd->ass_track_changed) vf->priv->prev_visibility = false; osd->ass_track_changed = false; - if (sub_visibility && osd->ass_track && (pts != MP_NOPTS_VALUE)) { + if (sub_visibility && osd->ass_track && (osd->pts != MP_NOPTS_VALUE)) { struct mp_eosd_res res = {0}; if (vo_control(video_out, VOCTRL_GET_EOSD_RES, &res) == VO_TRUE) { ass_set_frame_size(renderer, res.w, res.h); @@ -181,7 +178,7 @@ static int control(struct vf_instance *vf, int request, void* data) mp_ass_reload_options(vf->priv->renderer_vsfilter, vf->opts); } images.imgs = ass_render_frame(renderer, osd->ass_track, - (pts+sub_delay) * 1000 + .5, + (osd->pts+sub_delay) * 1000 + .5, &images.changed); if (!vf->priv->prev_visibility || osd->ass_force_reload) images.changed = 2; diff --git a/libmpcodecs/vfcap.h b/libmpcodecs/vfcap.h index 611d642869..c9b943177d 100644 --- a/libmpcodecs/vfcap.h +++ b/libmpcodecs/vfcap.h @@ -52,5 +52,7 @@ #define VFCAP_EOSD_UNSCALED 0x4000 // used by libvo and vf_vo, indicates the VO does not support draw_slice for this format #define VOCAP_NOSLICES 0x8000 +#define VFCAP_OSD_FILTER 0x10000 // OSD is drawn in filter chain +#define VFCAP_EOSD_FILTER 0x20000 // EOSD is drawn in filter chain #endif /* MPLAYER_VFCAP_H */ |