vo_drm: show osd in audio only mode

Signed-off-by: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2015-10-29 12:42:24 +01:00 committed by wm4
parent 33489feca8
commit 532f05b83d
1 changed files with 13 additions and 8 deletions

View File

@ -501,7 +501,8 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
{ {
struct priv *p = vo->priv; struct priv *p = vo->priv;
if (p->active && mpi) { if (p->active) {
if (mpi) {
struct mp_image src = *mpi; struct mp_image src = *mpi;
struct mp_rect src_rc = p->src; struct mp_rect src_rc = p->src;
src_rc.x0 = MP_ALIGN_DOWN(src_rc.x0, mpi->fmt.align_x); src_rc.x0 = MP_ALIGN_DOWN(src_rc.x0, mpi->fmt.align_x);
@ -509,6 +510,10 @@ static void draw_image(struct vo *vo, mp_image_t *mpi)
mp_image_crop_rc(&src, src_rc); mp_image_crop_rc(&src, src_rc);
mp_sws_scale(p->sws, p->cur_frame, &src); mp_sws_scale(p->sws, p->cur_frame, &src);
osd_draw_on_image(vo->osd, p->osd, src.pts, 0, p->cur_frame); osd_draw_on_image(vo->osd, p->osd, src.pts, 0, p->cur_frame);
} else {
mp_image_clear(p->cur_frame, 0, 0, p->cur_frame->w, p->cur_frame->h);
osd_draw_on_image(vo->osd, p->osd, 0, 0, p->cur_frame);
}
struct modeset_buf *front_buf = &p->dev->bufs[p->dev->front_buf]; struct modeset_buf *front_buf = &p->dev->bufs[p->dev->front_buf];
int w = p->dst.x1 - p->dst.x0; int w = p->dst.x1 - p->dst.x0;