diff options
author | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-16 19:58:37 +0000 |
---|---|---|
committer | Eduard Hasenleithner <ehasenle@users.sourceforge.net> | 2001-08-16 19:58:37 +0000 |
commit | e2515ab301743cc4aa68b2676e6e5ea73f7e0e84 (patch) | |
tree | 597b8187b21f424706ddff02fd641bd79f2d98fc | |
parent | 93c4dff094c2e46caa5418beda741214515cb271 (diff) | |
download | xine-lib-e2515ab301743cc4aa68b2676e6e5ea73f7e0e84.tar.gz xine-lib-e2515ab301743cc4aa68b2676e6e5ea73f7e0e84.tar.bz2 |
Moved XINE_SPU_EVENT handler to video_decoder.
SPU decoder is now preloaded for an spu event.
CVS patchset: 437
CVS date: 2001/08/16 19:58:37
-rw-r--r-- | src/xine-engine/video_decoder.c | 26 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 17 |
2 files changed, 31 insertions, 12 deletions
diff --git a/src/xine-engine/video_decoder.c b/src/xine-engine/video_decoder.c index 6a240975f..47937116c 100644 --- a/src/xine-engine/video_decoder.c +++ b/src/xine-engine/video_decoder.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: video_decoder.c,v 1.38 2001/08/15 11:35:47 f1rmb Exp $ + * $Id: video_decoder.c,v 1.39 2001/08/16 19:58:37 ehasenle Exp $ * */ @@ -194,6 +194,24 @@ void *video_decoder_loop (void *this_gen) { pthread_exit(NULL); } +static void spu_event_handler(xine_t *this, event_t *event, void *data) { + /* Check Xine handle is not NULL */ + if (this == NULL) { + return; + } + + switch(event->type) { + case XINE_SPU_EVENT: + if (!this->cur_spu_decoder_plugin) + update_spu_decoder(this, BUF_SPU_CLUT); /* preload spu decoder */ + + if (this->cur_spu_decoder_plugin) + this->cur_spu_decoder_plugin->event(this->cur_spu_decoder_plugin, + (spu_event_t*) event); + break; + } +} + void video_decoder_init (xine_t *this) { pthread_attr_t pth_attrs; @@ -201,6 +219,10 @@ void video_decoder_init (xine_t *this) { this->video_fifo = fifo_buffer_new (500, 65536); + if((xine_register_event_listener(this, spu_event_handler)) < 1) { + fprintf(stderr, "xine_register_event_listener() failed.\n"); + } + pthread_attr_init(&pth_attrs); pthread_attr_getschedparam(&pth_attrs, &pth_params); pth_params.sched_priority = sched_get_priority_min(SCHED_OTHER); @@ -214,6 +236,8 @@ void video_decoder_shutdown (xine_t *this) { buf_element_t *buf; void *p; + xine_remove_event_listener(this, spu_event_handler); + /* this->video_fifo->clear(this->video_fifo); */ buf = this->video_fifo->buffer_pool_alloc (this->video_fifo); diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 5b30316ff..42c7713c0 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: xine.c,v 1.41 2001/08/14 11:57:40 guenter Exp $ + * $Id: xine.c,v 1.42 2001/08/16 19:58:37 ehasenle Exp $ * * top-level xine functions * @@ -393,11 +393,6 @@ static void event_handler(xine_t *xine, event_t *event, void *data) { } } break; - case XINE_SPU_EVENT: - if (xine->cur_spu_decoder_plugin) - xine->cur_spu_decoder_plugin->event(xine->cur_spu_decoder_plugin, - (spu_event_t*) event); - break; } } @@ -425,6 +420,11 @@ xine_t *xine_init (vo_driver_t *vo, profiler_set_label (2, "video output "); /* + * init event listeners + */ + this->num_event_listeners = 0; /* Initially there are none */ + + /* * init lock */ @@ -466,11 +466,6 @@ xine_t *xine_init (vo_driver_t *vo, audio_decoder_init (this); printf("xine_init returning\n"); - /* - * init event listeners - */ - this->num_event_listeners = 0; /* Initially there are none */ - if((xine_register_event_listener(this, event_handler)) < 1) { fprintf(stderr, "xine_register_event_listener() failed.\n"); } |