summaryrefslogtreecommitdiffstats
path: root/video/out/vo_lavc.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-06-15 20:46:57 +0200
committerwm4 <wm4@nowhere>2014-06-15 20:53:15 +0200
commit716285782d5e4b264e18e253e9d58980183c76c6 (patch)
treeb03e6e0ead71828f9d68bdebe777a808bee5d26f /video/out/vo_lavc.c
parentd88aca6fb2474617136b09c2f281860d6a0a1a38 (diff)
downloadmpv-716285782d5e4b264e18e253e9d58980183c76c6.tar.bz2
mpv-716285782d5e4b264e18e253e9d58980183c76c6.tar.xz
video/out: change aspects of OSD handling
Let the VOs draw the OSD on their own, instead of making OSD drawing a separate VO driver call. Further, let it be the VOs responsibility to request subtitles with the correct PTS. We also basically allow the VO to request OSD/subtitles at any time. OSX changes untested.
Diffstat (limited to 'video/out/vo_lavc.c')
-rw-r--r--video/out/vo_lavc.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/video/out/vo_lavc.c b/video/out/vo_lavc.c
index ed23a27066..7bc9c1a3b7 100644
--- a/video/out/vo_lavc.c
+++ b/video/out/vo_lavc.c
@@ -486,31 +486,22 @@ static void draw_image_unlocked(struct vo *vo, mp_image_t *mpi)
static void draw_image(struct vo *vo, mp_image_t *mpi)
{
- pthread_mutex_lock(&vo->encode_lavc_ctx->lock);
- draw_image_unlocked(vo, mpi);
- pthread_mutex_unlock(&vo->encode_lavc_ctx->lock);
-}
-
-static void flip_page_timed(struct vo *vo, int64_t pts_us, int duration)
-{
-}
-
-static void draw_osd(struct vo *vo, struct osd_state *osd)
-{
struct priv *vc = vo->priv;
-
pthread_mutex_lock(&vo->encode_lavc_ctx->lock);
-
+ draw_image_unlocked(vo, mpi);
if (vc->lastimg && vc->lastimg_wants_osd && vo->params) {
struct mp_osd_res dim = osd_res_from_image_params(vo->params);
- osd_draw_on_image(osd, dim, osd_get_vo_pts(osd), OSD_DRAW_SUB_ONLY,
+ osd_draw_on_image(vo->osd, dim, mpi->pts, OSD_DRAW_SUB_ONLY,
vc->lastimg);
}
-
pthread_mutex_unlock(&vo->encode_lavc_ctx->lock);
}
+static void flip_page_timed(struct vo *vo, int64_t pts_us, int duration)
+{
+}
+
static int control(struct vo *vo, uint32_t request, void *data)
{
struct priv *vc = vo->priv;
@@ -536,7 +527,6 @@ const struct vo_driver video_out_lavc = {
.control = control,
.uninit = uninit,
.draw_image = draw_image,
- .draw_osd = draw_osd,
.flip_page_timed = flip_page_timed,
};