[vlc-commits] commit: Allowed vout_display_DeleteWindow(vd, NULL) to destroy unused window. (Laurent Aimar )
git at videolan.org
git at videolan.org
Thu May 20 23:53:22 CEST 2010
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu May 20 23:06:58 2010 +0200| [5741789dd874a3156b9c55a99b25bfa2053170b5] | committer: Laurent Aimar
Allowed vout_display_DeleteWindow(vd, NULL) to destroy unused window.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5741789dd874a3156b9c55a99b25bfa2053170b5
---
include/vlc_vout_display.h | 4 ++++
src/video_output/video_output.c | 9 +++++++--
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index 6f5b35f..8b32efc 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -389,6 +389,10 @@ static inline vout_window_t *vout_display_NewWindow(vout_display_t *vd, const vo
{
return vd->owner.window_new(vd, cfg);
}
+/**
+ * Deletes a window created by vout_display_NewWindow if window is non NULL
+ * or any unused windows otherwise.
+ */
static inline void vout_display_DeleteWindow(vout_display_t *vd,
vout_window_t *window)
{
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 21c4a8c..f9d8de2 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -504,10 +504,15 @@ void vout_DeleteDisplayWindow(vout_thread_t *vout, vout_display_t *vd,
vout_window_t *window)
{
VLC_UNUSED(vd);
- if (!vout->p->window.is_unused && vout->p->window.object == window)
+ if (!vout->p->window.is_unused && vout->p->window.object == window) {
vout->p->window.is_unused = true;
- else
+ } else if (vout->p->window.is_unused && vout->p->window.object && !window) {
+ vout_window_Delete(vout->p->window.object);
+ vout->p->window.is_unused = true;
+ vout->p->window.object = NULL;
+ } else if (window) {
vout_window_Delete(window);
+ }
}
/* */
More information about the vlc-commits
mailing list