[vlc-devel] commit: Fixed VOUT_DISPLAY_RESET_PICTURES support in wrapper. ( Laurent Aimar )
git version control
git at videolan.org
Sun Nov 1 12:46:58 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Nov 1 12:35:30 2009 +0100| [6f66d799a68c2fdd790d18579cc04fbea71d77f1] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6f66d799a68c2fdd790d18579cc04fbea71d77f1
---
include/vlc_vout_wrapper.h | 2 +-
modules/video_output/wrapper.c | 11 ++++++-----
src/video_output/display.c | 11 ++++++++---
src/video_output/display.h | 2 +-
4 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/include/vlc_vout_wrapper.h b/include/vlc_vout_wrapper.h
index a824f71..13637c9 100644
--- a/include/vlc_vout_wrapper.h
+++ b/include/vlc_vout_wrapper.h
@@ -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));
diff --git a/modules/video_output/wrapper.c b/modules/video_output/wrapper.c
index 3696ff5..1a3911e 100644
--- a/modules/video_output/wrapper.c
+++ b/modules/video_output/wrapper.c
@@ -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;
}
-
diff --git a/src/video_output/display.c b/src/video_output/display.c
index da5f4f9..5559797 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -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);
diff --git a/src/video_output/display.h b/src/video_output/display.h
index 16f7039..89e5dc7 100644
--- a/src/video_output/display.h
+++ b/src/video_output/display.h
@@ -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);
More information about the vlc-devel
mailing list