Commit 6f66d799 authored by Laurent Aimar's avatar Laurent Aimar

Fixed VOUT_DISPLAY_RESET_PICTURES support in wrapper.

Picture resources where not released when VOUT_DISPLAY_RESET_PICTURES
was called while direct rendering was used.
parent 1904f7d0
......@@ -79,7 +79,7 @@ VLC_EXPORT(bool, vout_IsDisplayFiltered, (vout_display_t *));
VLC_EXPORT(picture_t *, vout_FilterDisplay, (vout_display_t *, picture_t *));
VLC_EXPORT(bool, vout_AreDisplayPicturesInvalid, (vout_display_t *));
VLC_EXPORT(void, vout_ManageDisplay, (vout_display_t *));
VLC_EXPORT(void, vout_ManageDisplay, (vout_display_t *, bool allow_reset_pictures));
VLC_EXPORT(void, vout_SetDisplayFullscreen, (vout_display_t *, bool is_fullscreen));
VLC_EXPORT(void, vout_SetDisplayFilled, (vout_display_t *, bool is_filled));
......
......@@ -192,8 +192,7 @@ static void Close(vlc_object_t *object)
vout_thread_t *vout = (vout_thread_t *)object;
vout_sys_t *sys = vout->p_sys;
if (sys->vd)
vout_DeleteDisplay(sys->vd, NULL);
vout_DeleteDisplay(sys->vd, NULL);
free(sys->title);
free(sys );
}
......@@ -311,7 +310,11 @@ static void End(vout_thread_t *vout)
if (!sys->use_dr)
free(picture->p_data_orig);
free(picture->p_sys);
picture->i_status = FREE_PICTURE;
}
if (sys->use_dr && vout_AreDisplayPicturesInvalid(sys->vd))
vout_ManageDisplay(sys->vd, true);
}
/*****************************************************************************
......@@ -402,8 +405,7 @@ static int Manage(vout_thread_t *vout)
if (sys->use_dr && vout_AreDisplayPicturesInvalid(vd)) {
vout->i_changes |= VOUT_PICTURE_BUFFERS_CHANGE;
}
vout_ManageDisplay(vd);
vout_ManageDisplay(vd, !sys->use_dr);
return VLC_SUCCESS;
}
......@@ -480,4 +482,3 @@ static void VoutGetDisplayCfg(vout_thread_t *vout, vout_display_cfg_t *cfg, cons
else if (align_mask & 0x8)
cfg->align.horizontal = VOUT_DISPLAY_ALIGN_BOTTOM;
}
......@@ -633,7 +633,7 @@ static void VoutDisplayDelWindow(vout_display_t *vd, vout_window_t *window)
vout_DeleteDisplayWindow(osys->vout, vd, window);
}
void vout_ManageDisplay(vout_display_t *vd)
void vout_ManageDisplay(vout_display_t *vd, bool allow_reset_pictures)
{
vout_display_owner_sys_t *osys = vd->owner.sys;
......@@ -682,8 +682,13 @@ void vout_ManageDisplay(vout_display_t *vd)
bool display_is_forced = osys->display_is_forced;
osys->ch_display_size = false;
bool reset_pictures = osys->reset_pictures;
osys->reset_pictures = false;
bool reset_pictures;
if (allow_reset_pictures) {
reset_pictures = osys->reset_pictures;
osys->reset_pictures = false;
} else {
reset_pictures = false;
}
vlc_mutex_unlock(&osys->lock);
......
......@@ -96,7 +96,7 @@ void vout_DeleteDisplay(vout_display_t *, vout_display_state_t *);
picture_t *vout_FilterDisplay(vout_display_t *, picture_t *);
void vout_ManageDisplay(vout_display_t *);
void vout_ManageDisplay(vout_display_t *, bool allow_reset_pictures);
void vout_SetDisplayFullscreen(vout_display_t *, bool is_fullscreen);
void vout_SetDisplayFilled(vout_display_t *, bool is_filled);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment