summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrantišek Dvořák <valtri@civ.zcu.cz>2008-11-18 21:13:55 +0100
committerFrantišek Dvořák <valtri@civ.zcu.cz>2008-11-18 21:13:55 +0100
commit80738bd4f54bd6c73a68789303e8c34fa47d7dfa (patch)
treee2104035e1d80f479cdab98d03ddfe696b0d7b4e
parentb80a7ede37a61a5fa6760f508f4234679e32d4c4 (diff)
downloadxine-lib-80738bd4f54bd6c73a68789303e8c34fa47d7dfa.tar.gz
xine-lib-80738bd4f54bd6c73a68789303e8c34fa47d7dfa.tar.bz2
Fix of the two opened CACA windows in cacaxine (xine-ui).
There is needed some ui<->lib interaction: used caca display is optionally delivered from ui to the caca vo plugin.
-rw-r--r--src/video_out/video_out_caca.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c
index 3eec45211..65ebf707e 100644
--- a/src/video_out/video_out_caca.c
+++ b/src/video_out/video_out_caca.c
@@ -276,6 +276,7 @@ static int caca_redraw_needed (vo_driver_t *this_gen) {
static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) {
caca_class_t *class = (caca_class_t *) class_gen;
+ caca_display_t *dp = (caca_display_t *)visual_gen;
caca_driver_t *this;
this = calloc(1, sizeof (caca_driver_t));
@@ -300,8 +301,13 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
this->yuv2rgb_factory = yuv2rgb_factory_init(MODE_32_RGB, 0, NULL);
this->yuv2rgb_factory->set_csc_levels(this->yuv2rgb_factory, 0, 128, 128);
- this->cv = cucul_create_canvas(0, 0);
- this->dp = caca_create_display(this->cv);
+ if (dp) {
+ this->cv = caca_get_canvas(dp);
+ this->dp = dp;
+ } else {
+ this->cv = cucul_create_canvas(0, 0);
+ this->dp = caca_create_display(this->cv);
+ }
caca_refresh_display(this->dp);
return &this->vo_driver;