summaryrefslogtreecommitdiff
path: root/src/dxr3
diff options
context:
space:
mode:
Diffstat (limited to 'src/dxr3')
-rw-r--r--src/dxr3/Makefile.am1
-rw-r--r--src/dxr3/dxr3_decode_spu.c10
-rw-r--r--src/dxr3/dxr3_decode_video.c8
-rw-r--r--src/dxr3/dxr3_mpeg_encoders.c4
-rw-r--r--src/dxr3/dxr3_scr.c2
-rw-r--r--src/dxr3/video_out_dxr3.c18
6 files changed, 25 insertions, 18 deletions
diff --git a/src/dxr3/Makefile.am b/src/dxr3/Makefile.am
index f1a61ce12..3c2cbafbc 100644
--- a/src/dxr3/Makefile.am
+++ b/src/dxr3/Makefile.am
@@ -1,3 +1,4 @@
+include $(top_builddir)/misc/Makefile.plugins
include $(top_srcdir)/misc/Makefile.common
AM_CFLAGS = $(X_CFLAGS) $(LIBFAME_CFLAGS)
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 139939d8e..82c8f8da0 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.c
@@ -17,6 +17,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* dxr3 spu decoder plugin.
* Accepts the spu data from xine and sends it directly to the
@@ -198,7 +202,7 @@ static void *dxr3_spudec_init_plugin(xine_t *xine, void* data)
{
dxr3_spudec_class_t *this;
- this = (dxr3_spudec_class_t *)xine_xmalloc(sizeof(dxr3_spudec_class_t));
+ this = calloc(1, sizeof(dxr3_spudec_class_t));
if (!this) return NULL;
this->spu_decoder_class.open_plugin = dxr3_spudec_open_plugin;
@@ -221,7 +225,7 @@ static spu_decoder_t *dxr3_spudec_open_plugin(spu_decoder_class_t *class_gen, xi
if (class->instance) return NULL;
if (!dxr3_present(stream)) return NULL;
- this = (dxr3_spudec_t *)xine_xmalloc(sizeof(dxr3_spudec_t));
+ this = calloc(1, sizeof(dxr3_spudec_t));
if (!this) return NULL;
this->spu_decoder.decode_data = dxr3_spudec_decode_data;
@@ -374,7 +378,7 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
printf("dxr3_decode_spu: DEBUG: allocating new PCI node for hli_s_ptm %d\n", pci.hli.hl_gi.hli_s_ptm);
/* append PCI at the end of the list */
while (node->next) node = node->next;
- node->next = (pci_node_t *)xine_xmalloc(sizeof(pci_node_t));
+ node->next = calloc(1, sizeof(pci_node_t));
node->next->vpts = this->stream->metronom->got_spu_packet(this->stream->metronom, pci.hli.hl_gi.hli_s_ptm);
node->next->next = NULL;
xine_fast_memcpy(&node->next->pci, &pci, sizeof(pci_t));
diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c
index 3f1c273ff..e68ba2b5c 100644
--- a/src/dxr3/dxr3_decode_video.c
+++ b/src/dxr3/dxr3_decode_video.c
@@ -17,6 +17,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
/* dxr3 video decoder plugin.
* Accepts the video data from xine and sends it directly to the
@@ -193,7 +197,7 @@ static void *dxr3_init_plugin(xine_t *xine, void *data)
{
dxr3_decoder_class_t *this;
- this = (dxr3_decoder_class_t *)xine_xmalloc(sizeof (dxr3_decoder_class_t));
+ this = calloc(1, sizeof (dxr3_decoder_class_t));
if (!this) return NULL;
this->video_decoder_class.open_plugin = dxr3_open_plugin;
@@ -220,7 +224,7 @@ static video_decoder_t *dxr3_open_plugin(video_decoder_class_t *class_gen, xine_
if (class->instance) return NULL;
if (!dxr3_present(stream)) return NULL;
- this = (dxr3_decoder_t *)xine_xmalloc(sizeof (dxr3_decoder_t));
+ this = calloc(1, sizeof (dxr3_decoder_t));
if (!this) return NULL;
cfg = stream->xine->config;
diff --git a/src/dxr3/dxr3_mpeg_encoders.c b/src/dxr3/dxr3_mpeg_encoders.c
index 0c59b0b93..0077a465b 100644
--- a/src/dxr3/dxr3_mpeg_encoders.c
+++ b/src/dxr3/dxr3_mpeg_encoders.c
@@ -124,7 +124,7 @@ int dxr3_rte_init(dxr3_driver_t *drv)
return 0;
}
- this = xine_xmalloc(sizeof(rte_data_t));
+ this = calloc(1, sizeof(rte_data_t));
if (!this) return 0;
this->encoder_data.type = ENC_RTE;
@@ -316,7 +316,7 @@ int dxr3_fame_init(dxr3_driver_t *drv)
{
fame_data_t *this;
- this = xine_xmalloc(sizeof(fame_data_t));
+ this = calloc(1, sizeof(fame_data_t));
if (!this) return 0;
this->encoder_data.type = ENC_FAME;
diff --git a/src/dxr3/dxr3_scr.c b/src/dxr3/dxr3_scr.c
index 8fb049656..c95ab00a7 100644
--- a/src/dxr3/dxr3_scr.c
+++ b/src/dxr3/dxr3_scr.c
@@ -70,7 +70,7 @@ dxr3_scr_t *dxr3_scr_init(xine_t *xine)
int devnum;
char tmpstr[128];
- this = (dxr3_scr_t *)xine_xmalloc(sizeof(dxr3_scr_t));
+ this = calloc(1, sizeof(dxr3_scr_t));
devnum = xine->config->register_num(xine->config,
CONF_KEY, 0, CONF_NAME, CONF_HELP, 10, NULL, NULL);
diff --git a/src/dxr3/video_out_dxr3.c b/src/dxr3/video_out_dxr3.c
index c51354157..189824183 100644
--- a/src/dxr3/video_out_dxr3.c
+++ b/src/dxr3/video_out_dxr3.c
@@ -21,7 +21,7 @@
/* mpeg1 encoding video out plugin for the dxr3.
*
* modifications to the original dxr3 video out plugin by
- * Mike Lampard <mike at web2u.com.au>
+ * Mike Lampard <mlampard at users.sourceforge.net>
* this first standalone version by
* Harm van der Heijden <hrm at users.sourceforge.net>
*/
@@ -169,7 +169,7 @@ static dxr3_driver_class_t *dxr3_vo_init_plugin(xine_t *xine, void *visual_gen)
{
dxr3_driver_class_t *this;
- this = (dxr3_driver_class_t *)xine_xmalloc(sizeof(dxr3_driver_class_t));
+ this = calloc(1, sizeof(dxr3_driver_class_t));
if (!this) return NULL;
this->devnum = xine->config->register_num(xine->config,
@@ -232,7 +232,7 @@ static vo_driver_t *dxr3_vo_open_plugin(video_driver_class_t *class_gen, const v
if (class->instance) return NULL;
- this = (dxr3_driver_t *)xine_xmalloc(sizeof(dxr3_driver_t));
+ this = calloc(1, sizeof(dxr3_driver_t));
if (!this) return NULL;
this->vo_driver.get_capabilities = dxr3_get_capabilities;
@@ -536,7 +536,7 @@ static vo_frame_t *dxr3_alloc_frame(vo_driver_t *this_gen)
dxr3_frame_t *frame;
dxr3_driver_t *this = (dxr3_driver_t *)this_gen;
- frame = (dxr3_frame_t *)xine_xmalloc(sizeof(dxr3_frame_t));
+ frame = calloc(1, sizeof(dxr3_frame_t));
pthread_mutex_init(&frame->vo_frame.mutex, NULL);
@@ -1334,7 +1334,7 @@ static int lookup_parameter(struct lut_entry *lut, char *name,
static int dxr3_overlay_read_state(dxr3_overlay_t *this)
{
char *loc;
- char fname[256], tmp[128], line[256];
+ char *fname, line[256];
FILE *fp;
struct lut_entry lut[] = {
{"xoffset", TYPE_INT, &this->xoffset},
@@ -1359,18 +1359,16 @@ static int dxr3_overlay_read_state(dxr3_overlay_t *this)
* (used by .overlay/res file) */
setlocale(LC_NUMERIC, "C");
- snprintf(tmp, sizeof(tmp), "/res_%dx%dx%d",
+ asprintf(&fname, "%s/.overlay/res_%dx%dx%d", getenv("HOME"),
this->screen_xres, this->screen_yres, this->screen_depth);
- strncpy(fname, getenv("HOME"), sizeof(fname) - strlen(tmp) - sizeof("/.overlay"));
- fname[sizeof(fname) - strlen(tmp) - sizeof("/.overlay")] = '\0';
- strcat(fname, "/.overlay");
- strcat(fname, tmp);
llprintf(LOG_OVR, "attempting to open %s\n", fname);
if (!(fp = fopen(fname, "r"))) {
xprintf(this->xine, XINE_VERBOSITY_LOG,
_("video_out_dxr3: ERROR Reading overlay init file. Run autocal!\n"));
+ free(fname);
return -1;
}
+ free(fname);
while (!feof(fp)) {
if (!fgets(line, 256, fp))