summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Courtier-Dutton <jcdutton@users.sourceforge.net>2002-01-06 02:06:59 +0000
committerJames Courtier-Dutton <jcdutton@users.sourceforge.net>2002-01-06 02:06:59 +0000
commite84bedef4c59161a7e3babadc6ce8ce2217199ee (patch)
treeb60506cd3d1161a3a522a6d24465ce1d20f8fcfa
parentb1e67a12083921793d7c6659a53928d3d31ccccf (diff)
downloadxine-lib-e84bedef4c59161a7e3babadc6ce8ce2217199ee.tar.gz
xine-lib-e84bedef4c59161a7e3babadc6ce8ce2217199ee.tar.bz2
Partial fix for video_overlay handles management.
There is still a free missing, but osd and subtitles still work. CVS patchset: 1353 CVS date: 2002/01/06 02:06:59
-rw-r--r--src/xine-engine/osd.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index 9263674ad..b7ada470a 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -172,11 +172,16 @@ static int osd_show (osd_object_t *osd, uint32_t vpts ) {
printf("osd_show %p vpts=%d\n", osd, vpts);
#endif
- if( osd->handle >= 0 )
- return 0; /* must hide first */
+// if( osd->handle >= 0 )
+// return 0; /* must hide first */
- if( (osd->handle = this->video_overlay->get_handle(this->video_overlay,0)) == -1 )
- return 0;
+// if( (osd->handle = this->video_overlay->get_handle(this->video_overlay,0)) == -1 )
+// return 0;
+ if( osd->handle < 0 ) {
+ if( (osd->handle = this->video_overlay->get_handle(this->video_overlay,0)) == -1 ) {
+ return 0;
+ }
+ }
pthread_mutex_lock (&this->osd_mutex);
@@ -265,7 +270,7 @@ static int osd_hide (osd_object_t *osd, uint32_t vpts) {
pthread_mutex_lock (&this->osd_mutex);
this->event.object.handle = osd->handle;
- osd->handle = -1; /* handle will be freed after hide */
+// osd->handle = -1; /* handle will be freed after hide */
/* not really needed this, but good pratice to clean it up */
memset( this->event.object.overlay, 0, sizeof(this->event.object.overlay) );
@@ -774,8 +779,11 @@ static void osd_free_object (osd_object_t *osd_to_close) {
osd_renderer_t *this = osd_to_close->renderer;
osd_object_t *osd, *last;
- if( osd_to_close->handle >= 0 )
+ if( osd_to_close->handle >= 0 ) {
+/* FIXME:This should be replaced by a video_overlay free object. */
+ printf("osd.c:osd_free_object:trying to free overlay object\n");
osd_hide(osd_to_close,0);
+ }
pthread_mutex_lock (&this->osd_mutex);