diff options
Diffstat (limited to 'src/xine-engine/video_decoder.c')
-rw-r--r-- | src/xine-engine/video_decoder.c | 26 |
1 files changed, 25 insertions, 1 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); |