diff options
Diffstat (limited to 'src/libspucc')
-rw-r--r-- | src/libspucc/Makefile.am | 1 | ||||
-rw-r--r-- | src/libspucc/cc_decoder.c | 10 | ||||
-rw-r--r-- | src/libspucc/cc_decoder.h | 8 | ||||
-rw-r--r-- | src/libspucc/xine_cc_decoder.c | 18 |
4 files changed, 23 insertions, 14 deletions
diff --git a/src/libspucc/Makefile.am b/src/libspucc/Makefile.am index a8af8632e..1e170cdd5 100644 --- a/src/libspucc/Makefile.am +++ b/src/libspucc/Makefile.am @@ -1,3 +1,4 @@ +include $(top_builddir)/misc/Makefile.plugins include $(top_srcdir)/misc/Makefile.common xineplug_LTLIBRARIES = xineplug_decode_spucc.la diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c index 8d666e847..98c7319b6 100644 --- a/src/libspucc/cc_decoder.c +++ b/src/libspucc/cc_decoder.c @@ -27,6 +27,10 @@ * available at http://sourceforge.net/projects/ccdecoder/. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -216,8 +220,6 @@ static const uint8_t *const cc_alpha_palettes[NUM_CC_PALETTES] = { #define TRANSP_SPACE 0x19 /* code for transparent space, essentially arbitrary */ -#define MAX(a, b) ((a) > (b)? (a) : (b)) - /* mapping from PAC row code to actual CC row */ static const int rowdata[] = {10, -1, 0, 1, 2, 3, 11, 12, 13, 14, 4, 5, 6, 7, 8, 9}; @@ -922,7 +924,7 @@ cc_renderer_t *cc_renderer_open(osd_renderer_t *osd_renderer, metronom_t *metronom, cc_state_t *cc_state, int video_width, int video_height) { - cc_renderer_t *this = (cc_renderer_t *) xine_xmalloc(sizeof (cc_renderer_t)); + cc_renderer_t *this = calloc(1, sizeof (cc_renderer_t)); this->osd_renderer = osd_renderer; this->metronom = metronom; @@ -1439,7 +1441,7 @@ void decode_cc(cc_decoder_t *this, uint8_t *buffer, uint32_t buf_len, cc_decoder_t *cc_decoder_open(cc_state_t *cc_state) { - cc_decoder_t *this = (cc_decoder_t *) xine_xmalloc(sizeof (cc_decoder_t)); + cc_decoder_t *this = calloc(1, sizeof (cc_decoder_t)); /* configfile stuff */ this->cc_state = cc_state; diff --git a/src/libspucc/cc_decoder.h b/src/libspucc/cc_decoder.h index 8698189a6..47703b6d1 100644 --- a/src/libspucc/cc_decoder.h +++ b/src/libspucc/cc_decoder.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * Copyright (C) Christian Vogler * cvogler@gradient.cis.upenn.edu - December 2001 @@ -31,11 +31,7 @@ typedef struct cc_decoder_s cc_decoder_t; typedef struct cc_renderer_s cc_renderer_t; #define NUM_CC_PALETTES 2 -static const char *cc_schemes[NUM_CC_PALETTES + 1] = { - "White/Gray/Translucent", - "White/Black/Solid", - NULL -}; +extern const char *cc_schemes[]; #define CC_FONT_MAX 256 diff --git a/src/libspucc/xine_cc_decoder.c b/src/libspucc/xine_cc_decoder.c index 9cdb4c4ea..12a5e7132 100644 --- a/src/libspucc/xine_cc_decoder.c +++ b/src/libspucc/xine_cc_decoder.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2000-2003 the xine project + * Copyright (C) 2000-2008 the xine project * * This file is part of xine, a free video player. * @@ -20,6 +20,10 @@ * closed caption spu decoder. receive data by events. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -33,6 +37,12 @@ #define LOG_DEBUG 1 */ +const char *cc_schemes[NUM_CC_PALETTES + 1] = { + "White/Gray/Translucent", + "White/Black/Solid", + NULL +}; + typedef struct spucc_decoder_s { spu_decoder_t spu_decoder; @@ -193,7 +203,7 @@ static void spucc_register_cfg_vars(spucc_class_t *this, cc_vars->cc_scheme = xine_cfg->register_enum(xine_cfg, "subtitles.closedcaption.scheme", 0, - cc_schemes, + (char **)cc_schemes, _("closed-captioning foreground/background scheme"), _("Choose your favourite rendering of the closed " "captions."), @@ -301,7 +311,7 @@ static spu_decoder_t *spudec_open_plugin (spu_decoder_class_t *class, xine_strea spucc_decoder_t *this ; - this = (spucc_decoder_t *) xine_xmalloc (sizeof (spucc_decoder_t)); + this = (spucc_decoder_t *) calloc(1, sizeof(spucc_decoder_t)); this->spu_decoder.decode_data = spudec_decode_data; this->spu_decoder.reset = spudec_reset; @@ -338,7 +348,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { spucc_class_t *this ; - this = (spucc_class_t *) xine_xmalloc (sizeof (spucc_class_t)); + this = (spucc_class_t *) calloc(1, sizeof(spucc_class_t)); this->spu_class.open_plugin = spudec_open_plugin; this->spu_class.get_identifier = spudec_get_identifier; |