summaryrefslogtreecommitdiff
path: root/src/libxinevdec
diff options
context:
space:
mode:
Diffstat (limited to 'src/libxinevdec')
-rw-r--r--src/libxinevdec/Makefile.am3
-rw-r--r--src/libxinevdec/bitplane.c36
-rw-r--r--src/libxinevdec/foovideo.c8
-rw-r--r--src/libxinevdec/gdkpixbuf.c9
-rw-r--r--src/libxinevdec/image.c12
-rw-r--r--src/libxinevdec/rgb.c10
-rw-r--r--src/libxinevdec/xine_theora_decoder.c4
-rw-r--r--src/libxinevdec/yuv.c8
8 files changed, 54 insertions, 36 deletions
diff --git a/src/libxinevdec/Makefile.am b/src/libxinevdec/Makefile.am
index 9805eb09e..b7dbe1db1 100644
--- a/src/libxinevdec/Makefile.am
+++ b/src/libxinevdec/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
AM_CFLAGS = $(VISIBILITY_FLAG)
@@ -43,4 +44,4 @@ xineplug_decode_gdk_pixbuf_la_LIBADD = $(XINE_LIB) $(DYNAMIC_LD_LIBS) $(GDK_PIXB
xineplug_decode_theora_la_SOURCES = xine_theora_decoder.c
xineplug_decode_theora_la_CFLAGS = $(AM_CFLAGS) $(OGG_CFLAGS) $(THEORA_CFLAGS)
-xineplug_decode_theora_la_LIBADD = $(XINE_LIB) $(OGG_LIBS) $(THEORA_LIBS)
+xineplug_decode_theora_la_LIBADD = $(XINE_LIB) $(OGG_LIBS) $(THEORA_LIBS) $(LTLIBINTL)
diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c
index bf868ad2a..76b7c8a89 100644
--- a/src/libxinevdec/bitplane.c
+++ b/src/libxinevdec/bitplane.c
@@ -29,6 +29,10 @@
* - untested (found no testfiles) IFF-ANIM OPT 3, 4 and 6
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -252,7 +256,7 @@ static uint8_t *bitplane_decode_byterun1 (uint8_t *compressed,
int i = 0;
int j = 0;
- uint8_t *uncompressed = xine_xmalloc( size_uncompressed );
+ uint8_t *uncompressed = calloc(1, size_uncompressed );
while ( i < size_compressed &&
pixel_ptr < size_uncompressed ) {
@@ -1158,8 +1162,8 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
this->bytes_per_pixel = 1;
/* New Buffer for indexes (palette based formats) */
- this->index_buf = xine_xmalloc( this->num_pixel * this->bytes_per_pixel );
- this->index_buf_hist = xine_xmalloc( this->num_pixel * this->bytes_per_pixel );
+ this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel );
+ this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel );
this->num_bitplanes = bih->biPlanes;
this->camg_mode = bih->biCompression;
@@ -1189,7 +1193,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
if (this->buf)
free (this->buf);
this->bufsize = VIDEOBUFSIZE;
- this->buf = xine_xmalloc(this->bufsize);
+ this->buf = calloc(1, this->bufsize);
this->size = 0;
this->framenumber = 0;
@@ -1255,7 +1259,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
case BUF_VIDEO_BITPLANE:
/* uncompressed Buffer, set decoded_buf pointer direct to input stream */
if( this->buf_uk == NULL )
- this->buf_uk = xine_xmalloc( (this->size) );
+ this->buf_uk = malloc(this->size);
xine_fast_memcpy (this->buf_uk, this->buf, this->size);
break;
case BUF_VIDEO_BITPLANE_BR1:
@@ -1294,7 +1298,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
}
}
if( this->buf_uk_hist == NULL ) {
- this->buf_uk_hist = xine_xmalloc( (this->size_uk) );
+ this->buf_uk_hist = malloc(this->size_uk);
xine_fast_memcpy (this->buf_uk_hist, this->buf_uk, this->size_uk);
xine_fast_memcpy (this->index_buf_hist, this->index_buf,
(this->num_pixel * this->bytes_per_pixel));
@@ -1306,20 +1310,12 @@ static void bitplane_decode_data (video_decoder_t *this_gen,
/* when no start-picture is given, create a empty one */
if( this->buf_uk_hist == NULL ) {
this->size_uk = (((this->num_pixel) / 8) * this->num_bitplanes);
- this->buf_uk = xine_xmalloc( (this->size_uk) );
- this->buf_uk_hist = xine_xmalloc( (this->size_uk) );
- for (i = 0; i < this->size_uk; i++) {
- this->buf_uk[i] = 0;
- this->buf_uk_hist[i] = 0;
- }
+ this->buf_uk = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
+ this->buf_uk_hist = calloc(this->num_bitplanes, ((this->num_pixel) / 8));
}
if( this->index_buf == NULL ) {
- this->index_buf = xine_xmalloc( (this->num_pixel * this->bytes_per_pixel) );
- this->index_buf_hist = xine_xmalloc( (this->num_pixel * this->bytes_per_pixel) );
- for (i = 0; i < (this->num_pixel * this->bytes_per_pixel); i++) {
- this->index_buf[i] = 0;
- this->index_buf_hist[i] = 0;
- }
+ this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel );
+ this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel );
}
switch( anhd->operation ) {
@@ -1523,7 +1519,7 @@ static void bitplane_dispose (video_decoder_t *this_gen) {
static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) {
- bitplane_decoder_t *this = (bitplane_decoder_t *) xine_xmalloc (sizeof (bitplane_decoder_t));
+ bitplane_decoder_t *this = (bitplane_decoder_t *) calloc(1, sizeof(bitplane_decoder_t));
this->video_decoder.decode_data = bitplane_decode_data;
this->video_decoder.flush = bitplane_flush;
@@ -1558,7 +1554,7 @@ static void dispose_class (video_decoder_class_t *this) {
static void *init_plugin (xine_t *xine, void *data) {
- bitplane_class_t *this = (bitplane_class_t *) xine_xmalloc (sizeof (bitplane_class_t));
+ bitplane_class_t *this = (bitplane_class_t *) calloc(1, sizeof(bitplane_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/foovideo.c b/src/libxinevdec/foovideo.c
index 98e0ebc0b..7a80c7c66 100644
--- a/src/libxinevdec/foovideo.c
+++ b/src/libxinevdec/foovideo.c
@@ -24,6 +24,10 @@
* frame when the frames are played in succession.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -206,7 +210,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
foovideo_decoder_t *this ;
- this = (foovideo_decoder_t *) xine_xmalloc (sizeof (foovideo_decoder_t));
+ this = (foovideo_decoder_t *) calloc(1, sizeof(foovideo_decoder_t));
this->video_decoder.decode_data = foovideo_decode_data;
this->video_decoder.flush = foovideo_flush;
@@ -256,7 +260,7 @@ static void *init_plugin (xine_t *xine, void *data) {
foovideo_class_t *this;
- this = (foovideo_class_t *) xine_xmalloc (sizeof (foovideo_class_t));
+ this = (foovideo_class_t *) calloc(1, sizeof(foovideo_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/gdkpixbuf.c b/src/libxinevdec/gdkpixbuf.c
index b5acdfa42..de4c2271e 100644
--- a/src/libxinevdec/gdkpixbuf.c
+++ b/src/libxinevdec/gdkpixbuf.c
@@ -20,6 +20,11 @@
* a gdk-pixbuf-based image video decoder
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
#include <stdlib.h>
#include <string.h>
@@ -236,7 +241,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
g_type_init ();
- this = (image_decoder_t *) xine_xmalloc (sizeof (image_decoder_t));
+ this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
this->video_decoder.decode_data = image_decode_data;
this->video_decoder.flush = image_flush;
@@ -277,7 +282,7 @@ static void *init_class (xine_t *xine, void *data) {
image_class_t *this;
- this = (image_class_t *) xine_xmalloc (sizeof (image_class_t));
+ this = (image_class_t *) calloc(1, sizeof(image_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/image.c b/src/libxinevdec/image.c
index a338e3cab..bd749be8e 100644
--- a/src/libxinevdec/image.c
+++ b/src/libxinevdec/image.c
@@ -20,6 +20,10 @@
* a image video decoder
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdlib.h>
#include <string.h>
@@ -88,7 +92,7 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
if (buf->decoder_flags & BUF_FLAG_FRAME_END) {
int width, height, i;
- MagickBooleanType status;
+ int status;
MagickWand *wand;
uint8_t *img_buf, *img_buf_ptr;
yuv_planes_t yuv_planes;
@@ -101,7 +105,7 @@ static void image_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
status = MagickReadImageBlob(wand, this->image, this->index);
this->index = 0;
- if (status == MagickFalse) {
+ if (!status) {
DestroyMagickWand(wand);
lprintf("error loading image\n");
return;
@@ -212,7 +216,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen,
lprintf("opened\n");
- this = (image_decoder_t *) xine_xmalloc (sizeof (image_decoder_t));
+ this = (image_decoder_t *) calloc(1, sizeof(image_decoder_t));
this->video_decoder.decode_data = image_decode_data;
this->video_decoder.flush = image_flush;
@@ -255,7 +259,7 @@ static void *init_class (xine_t *xine, void *data) {
image_class_t *this;
- this = (image_class_t *) xine_xmalloc (sizeof (image_class_t));
+ this = (image_class_t *) calloc(1, sizeof(image_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c
index 0e7be4c18..fc206a0ce 100644
--- a/src/libxinevdec/rgb.c
+++ b/src/libxinevdec/rgb.c
@@ -31,6 +31,10 @@
* indicated by a negative height parameter.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -145,7 +149,7 @@ static void rgb_decode_data (video_decoder_t *this_gen,
/* minimal buffer size */
this->bufsize = this->width * this->height * this->bytes_per_pixel;
- this->buf = xine_xmalloc(this->bufsize);
+ this->buf = calloc(1, this->bufsize);
this->size = 0;
init_yuv_planes(&this->yuv_planes, this->width, this->height);
@@ -398,7 +402,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
rgb_decoder_t *this ;
- this = (rgb_decoder_t *) xine_xmalloc (sizeof (rgb_decoder_t));
+ this = (rgb_decoder_t *) calloc(1, sizeof(rgb_decoder_t));
this->video_decoder.decode_data = rgb_decode_data;
this->video_decoder.flush = rgb_flush;
@@ -432,7 +436,7 @@ static void *init_plugin (xine_t *xine, void *data) {
rgb_class_t *this;
- this = (rgb_class_t *) xine_xmalloc (sizeof (rgb_class_t));
+ this = (rgb_class_t *) calloc(1, sizeof(rgb_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxinevdec/xine_theora_decoder.c b/src/libxinevdec/xine_theora_decoder.c
index c71ce7559..d15625812 100644
--- a/src/libxinevdec/xine_theora_decoder.c
+++ b/src/libxinevdec/xine_theora_decoder.c
@@ -312,7 +312,7 @@ static video_decoder_t *theora_open_plugin (video_decoder_class_t *class_gen, xi
theora_decoder_t *this ;
- this = (theora_decoder_t *) xine_xmalloc (sizeof (theora_decoder_t));
+ this = (theora_decoder_t *) calloc(1, sizeof(theora_decoder_t));
this->theora_decoder.decode_data = theora_decode_data;
this->theora_decoder.flush = theora_flush;
@@ -370,7 +370,7 @@ static void *init_plugin (xine_t *xine, void *data) {
/*initialize our plugin*/
theora_class_t *this;
- this = (theora_class_t *) xine_xmalloc (sizeof (theora_class_t));
+ this = (theora_class_t *) calloc(1, sizeof(theora_class_t));
this->decoder_class.open_plugin = theora_open_plugin;
this->decoder_class.get_identifier = theora_get_identifier;
diff --git a/src/libxinevdec/yuv.c b/src/libxinevdec/yuv.c
index 2b8657685..b1a69cd65 100644
--- a/src/libxinevdec/yuv.c
+++ b/src/libxinevdec/yuv.c
@@ -22,6 +22,10 @@
* a way that xine can display them.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -321,7 +325,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
yuv_decoder_t *this ;
- this = (yuv_decoder_t *) xine_xmalloc (sizeof (yuv_decoder_t));
+ this = (yuv_decoder_t *) calloc(1, sizeof(yuv_decoder_t));
this->video_decoder.decode_data = yuv_decode_data;
this->video_decoder.flush = yuv_flush;
@@ -355,7 +359,7 @@ static void *init_plugin (xine_t *xine, void *data) {
yuv_class_t *this;
- this = (yuv_class_t *) xine_xmalloc (sizeof (yuv_class_t));
+ this = (yuv_class_t *) calloc(1, sizeof(yuv_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;