summaryrefslogtreecommitdiff
path: root/src/video_out/video_out_caca.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_out/video_out_caca.c')
-rw-r--r--src/video_out/video_out_caca.c55
1 files changed, 14 insertions, 41 deletions
diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c
index 866eabcd8..231befcdb 100644
--- a/src/video_out/video_out_caca.c
+++ b/src/video_out/video_out_caca.c
@@ -94,15 +94,11 @@ static uint32_t caca_get_capabilities (vo_driver_t *this) {
static void caca_dispose_frame (vo_frame_t *vo_img) {
caca_frame_t *frame = (caca_frame_t *)vo_img;
- if (frame->mem[0])
- free (frame->mem[0]);
- if (frame->mem[1])
- free (frame->mem[1]);
- if (frame->mem[2])
- free (frame->mem[2]);
-
- if (frame->pixmap_d)
- free (frame->pixmap_d);
+ free (frame->mem[0]);
+ free (frame->mem[1]);
+ free (frame->mem[2]);
+
+ free (frame->pixmap_d);
if (frame->pixmap_s)
cucul_free_dither (frame->pixmap_s);
@@ -148,23 +144,12 @@ static void caca_update_frame_format (vo_driver_t *this_gen, vo_frame_t *img,
if ((frame->width != width) || (frame->height != height)
|| (frame->format != format)) {
- if (frame->mem[0]) {
- free (frame->mem[0]);
- frame->mem[0] = NULL;
- }
- if (frame->mem[1]) {
- free (frame->mem[1]);
- frame->mem[1] = NULL;
- }
- if (frame->mem[2]) {
- free (frame->mem[2]);
- frame->mem[2] = NULL;
- }
+ free (frame->mem[0]); frame->mem[0] = NULL;
+ free (frame->mem[1]); frame->mem[1] = NULL;
+ free (frame->mem[2]); frame->mem[2] = NULL;
+
+ free (frame->pixmap_d); frame->pixmap_d = NULL;
- if (frame->pixmap_d) {
- free (frame->pixmap_d);
- frame->pixmap_d = NULL;
- }
if (frame->pixmap_s) {
cucul_free_dither (frame->pixmap_s);
frame->pixmap_s = NULL;
@@ -307,27 +292,15 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi
return &this->vo_driver;
}
-static char* get_identifier (video_driver_class_t *this_gen) {
- return "CACA";
-}
-
-static char* get_description (video_driver_class_t *this_gen) {
- return _("xine video output plugin using the Color AsCii Art library");
-}
-
-static void dispose_class (video_driver_class_t *this_gen) {
- caca_class_t *this = (caca_class_t *) this_gen;
- free(this);
-}
static void *init_class (xine_t *xine, void *visual_gen) {
caca_class_t *this;
this = (caca_class_t *) xine_xmalloc(sizeof(caca_class_t));
this->driver_class.open_plugin = open_plugin;
- this->driver_class.get_identifier = get_identifier;
- this->driver_class.get_description = get_description;
- this->driver_class.dispose = dispose_class;
+ this->driver_class.identifier = "CACA";
+ this->driver_class.description = N_("xine video output plugin using the Color AsCii Art library");
+ this->driver_class.dispose = default_video_driver_class_dispose;
this->config = xine->config;
this->xine = xine;
@@ -342,6 +315,6 @@ static const vo_info_t vo_info_caca = {
const plugin_info_t xine_plugin_info[] EXPORTED = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_OUT, 21, "caca", XINE_VERSION_CODE, &vo_info_caca, init_class },
+ { PLUGIN_VIDEO_OUT, 22, "caca", XINE_VERSION_CODE, &vo_info_caca, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};