diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-07 17:11:22 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2008-05-07 17:11:22 +0200 |
commit | 4527fd438b39dc312c69839f051e0a2ac0046356 (patch) | |
tree | d3b2dc1f89617e86c619575e3324534c523ed673 | |
parent | 47c1651eb8c42ab6dddaff7c0663c45ac49b4fcf (diff) | |
parent | 88d23a2dbabf419ab4014b449be119a741aa54f5 (diff) | |
download | xine-lib-4527fd438b39dc312c69839f051e0a2ac0046356.tar.gz xine-lib-4527fd438b39dc312c69839f051e0a2ac0046356.tar.bz2 |
Merge file removal.
203 files changed, 521 insertions, 565 deletions
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c index 4ce2b1be3..e68d80a71 100644 --- a/src/audio_out/audio_alsa_out.c +++ b/src/audio_out/audio_alsa_out.c @@ -1350,7 +1350,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da #define A52_PASSTHRU 12 int speakers; - this = (alsa_driver_t *) xine_xmalloc (sizeof (alsa_driver_t)); + this = calloc(1, sizeof (alsa_driver_t)); if (!this) return NULL; @@ -1682,7 +1682,7 @@ static void *init_class (xine_t *xine, void *data) { alsa_class_t *this; - this = (alsa_class_t *) xine_xmalloc (sizeof (alsa_class_t)); + this = calloc(1, sizeof (alsa_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_arts_out.c b/src/audio_out/audio_arts_out.c index 0f0467b4a..14bf5c965 100644 --- a/src/audio_out/audio_arts_out.c +++ b/src/audio_out/audio_arts_out.c @@ -303,7 +303,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da lprintf ("audio_arts_out: open_plugin called\n"); - this = (arts_driver_t *) xine_xmalloc (sizeof (arts_driver_t)); + this = calloc(1, sizeof (arts_driver_t)); if (!this) return NULL; @@ -384,7 +384,7 @@ static void *init_class (xine_t *xine, void *data) { lprintf ("audio_arts_out: init class\n"); - this = (arts_class_t *) xine_xmalloc (sizeof (arts_class_t)); + this = calloc(1, sizeof (arts_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_coreaudio_out.c b/src/audio_out/audio_coreaudio_out.c index eecab8f95..642f920c7 100644 --- a/src/audio_out/audio_coreaudio_out.c +++ b/src/audio_out/audio_coreaudio_out.c @@ -530,7 +530,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, lprintf ("open_plugin called\n"); - this = (coreaudio_driver_t *) xine_xmalloc (sizeof (coreaudio_driver_t)); + this = calloc(1, sizeof (coreaudio_driver_t)); if (!this) return NULL; @@ -582,7 +582,7 @@ static void *init_class (xine_t *xine, void *data) { lprintf ("init class\n"); - this = (coreaudio_class_t *) xine_xmalloc (sizeof (coreaudio_class_t)); + this = calloc(1, sizeof (coreaudio_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_directx2_out.c b/src/audio_out/audio_directx2_out.c index d9688b647..5fffd1e2d 100644 --- a/src/audio_out/audio_directx2_out.c +++ b/src/audio_out/audio_directx2_out.c @@ -955,7 +955,7 @@ static ao_driver_t *open_plugin(audio_driver_class_t *class_gen, const void *dat lprintf("open plugin called\n"); - this = (dx2_driver_t *)xine_xmalloc(sizeof(dx2_driver_t)); + this = calloc(1, sizeof(dx2_driver_t)); if (!this) return NULL; @@ -1009,7 +1009,7 @@ static void *init_class(xine_t *xine, void *data) { lprintf("init class\n"); - this = (dx2_class_t *)xine_xmalloc(sizeof(dx2_class_t)); + this = calloc(1, sizeof(dx2_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_directx_out.c b/src/audio_out/audio_directx_out.c index 77e3e15b9..7c99e97e2 100644 --- a/src/audio_out/audio_directx_out.c +++ b/src/audio_out/audio_directx_out.c @@ -790,7 +790,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da audiox_class_t *class = (audiox_class_t *) class_gen; ao_directx_t *ao_directx; - ao_directx = ( ao_directx_t * ) xine_xmalloc( sizeof( ao_directx_t ) ); + ao_directx = calloc(1, sizeof(ao_directx_t)); if (!ao_directx) return NULL; @@ -841,7 +841,7 @@ static void *init_class (xine_t *xine, void *data) { /* * from this point on, nothing should go wrong anymore */ - audiox = (audiox_class_t *) xine_xmalloc (sizeof (audiox_class_t)); + audiox = calloc(1, sizeof (audiox_class_t)); if (!audiox) return NULL; diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c index 4b209bea1..63c54b546 100644 --- a/src/audio_out/audio_esd_out.c +++ b/src/audio_out/audio_esd_out.c @@ -521,7 +521,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, esd_close(audio_fd); - this = (esd_driver_t *) xine_xmalloc (sizeof (esd_driver_t)); + this = calloc(1, sizeof (esd_driver_t)); if (!this) return NULL; this->xine = class->xine; @@ -583,7 +583,7 @@ static void *init_class (xine_t *xine, void *data) { esd_class_t *this; - this = (esd_class_t *) xine_xmalloc (sizeof (esd_class_t)); + this = calloc(1, sizeof (esd_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_file_out.c b/src/audio_out/audio_file_out.c index 225d64d0e..699a5cf54 100644 --- a/src/audio_out/audio_file_out.c +++ b/src/audio_out/audio_file_out.c @@ -323,7 +323,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, lprintf ("open_plugin called\n"); - this = (file_driver_t *) xine_xmalloc (sizeof (file_driver_t)); + this = calloc(1, sizeof (file_driver_t)); if (!this) return NULL; @@ -375,7 +375,7 @@ static void *init_class (xine_t *xine, void *data) { lprintf ("init class\n"); - this = (file_class_t *) xine_xmalloc (sizeof (file_class_t)); + this = calloc(1, sizeof (file_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_fusionsound_out.c b/src/audio_out/audio_fusionsound_out.c index 92eadc6cf..1480cd6d2 100644 --- a/src/audio_out/audio_fusionsound_out.c +++ b/src/audio_out/audio_fusionsound_out.c @@ -393,7 +393,7 @@ static ao_driver_t* open_plugin(audio_driver_class_t *ao_class, char **argp = (char **) args; DFBResult ret; - this = (fusionsound_driver_t *) xine_xmalloc (sizeof(fusionsound_driver_t)); + this = calloc(1, sizeof(fusionsound_driver_t)); if (!this) { xprintf (class->xine, XINE_VERBOSITY_LOG, "audio_fusionsound_out: driver interface allocation failed!\n"); @@ -460,7 +460,7 @@ static void* init_class(xine_t *xine, void *data) { return NULL; } - class = (fusionsound_class_t *) xine_xmalloc (sizeof( fusionsound_class_t)); + class = calloc(1, sizeof( fusionsound_class_t)); if (!class) { xprintf (xine, XINE_VERBOSITY_LOG, "audio_fusionsound_out: class interface allocation failed!\n"); diff --git a/src/audio_out/audio_jack_out.c b/src/audio_out/audio_jack_out.c index 1bc070527..070b96df8 100644 --- a/src/audio_out/audio_jack_out.c +++ b/src/audio_out/audio_jack_out.c @@ -328,7 +328,7 @@ static ao_driver_t *open_jack_plugin (audio_driver_class_t *class_gen, } } - this = (jack_driver_t *) xine_xmalloc (sizeof (jack_driver_t)); + this = calloc(1, sizeof (jack_driver_t)); this->client = client; @@ -416,7 +416,7 @@ static void *init_class (xine_t *xine, void *data) { jack_class_t *this; - this = (jack_class_t *) xine_xmalloc (sizeof (jack_class_t)); + this = calloc(1, sizeof (jack_class_t)); this->driver_class.open_plugin = open_jack_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/audio_out/audio_none_out.c b/src/audio_out/audio_none_out.c index a815d645a..9ba9a00ca 100644 --- a/src/audio_out/audio_none_out.c +++ b/src/audio_out/audio_none_out.c @@ -186,7 +186,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, lprintf ("open_plugin called\n"); - this = (none_driver_t *) xine_xmalloc (sizeof (none_driver_t)); + this = calloc(1, sizeof (none_driver_t)); if (!this) return NULL; @@ -236,7 +236,7 @@ static void *init_class (xine_t *xine, void *data) { lprintf ("init class\n"); - this = (none_class_t *) xine_xmalloc (sizeof (none_class_t)); + this = calloc(1, sizeof (none_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 40d5bcfdc..8c1e38ea7 100644 --- a/src/audio_out/audio_oss_out.c +++ b/src/audio_out/audio_oss_out.c @@ -729,7 +729,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da int speakers; - this = (oss_driver_t *) xine_xmalloc (sizeof (oss_driver_t)); + this = calloc(1, sizeof (oss_driver_t)); if (!this) return NULL; @@ -1170,7 +1170,7 @@ static void *init_class (xine_t *xine, void *data) { oss_class_t *this; - this = (oss_class_t *) xine_xmalloc (sizeof (oss_class_t)); + this = calloc(1, sizeof (oss_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_pulse_out.c b/src/audio_out/audio_pulse_out.c index 5a25db5ff..dfae98c31 100644 --- a/src/audio_out/audio_pulse_out.c +++ b/src/audio_out/audio_pulse_out.c @@ -745,7 +745,7 @@ static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *da lprintf ("audio_pulse_out: open_plugin called\n"); - this = (pulse_driver_t *) xine_xmalloc (sizeof (pulse_driver_t)); + this = calloc(1, sizeof (pulse_driver_t)); if (!this) return NULL; @@ -856,7 +856,7 @@ static void *init_class (xine_t *xine, void *data) { lprintf ("audio_pulse_out: init class\n"); - this = (pulse_class_t *) xine_xmalloc (sizeof (pulse_class_t)); + this = calloc(1, sizeof (pulse_class_t)); if (!this) return NULL; diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c index b23955b77..048db6b86 100644 --- a/src/audio_out/audio_sun_out.c +++ b/src/audio_out/audio_sun_out.c @@ -909,7 +909,7 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v int status; audio_info_t info; - this = (sun_driver_t *) xine_xmalloc (sizeof (sun_driver_t)); + this = calloc(1, sizeof (sun_driver_t)); if (!this) return NULL; @@ -1032,7 +1032,7 @@ static void ao_sun_dispose_class (audio_driver_class_t *this_gen) { static void *ao_sun_init_class (xine_t *xine, void *data) { sun_class_t *this; - this = (sun_class_t *) xine_xmalloc (sizeof (sun_class_t)); + this = calloc(1, sizeof (sun_class_t)); if (!this) return NULL; diff --git a/src/combined/decoder_flac.c b/src/combined/decoder_flac.c index e9c9e6ea1..e5884006a 100644 --- a/src/combined/decoder_flac.c +++ b/src/combined/decoder_flac.c @@ -337,7 +337,7 @@ static audio_decoder_t * open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) { flac_decoder_t *this ; - this = (flac_decoder_t *) xine_xmalloc (sizeof (flac_decoder_t)); + this = calloc(1, sizeof (flac_decoder_t)); this->audio_decoder.decode_data = flac_decode_data; this->audio_decoder.reset = flac_reset; @@ -409,7 +409,7 @@ static void * init_plugin (xine_t *xine, void *data) { flac_class_t *this; - this = (flac_class_t *) xine_xmalloc (sizeof (flac_class_t)); + this = calloc(1, sizeof (flac_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/combined/decoder_wavpack.c b/src/combined/decoder_wavpack.c index f8a301c9f..36bf0deab 100644 --- a/src/combined/decoder_wavpack.c +++ b/src/combined/decoder_wavpack.c @@ -291,7 +291,7 @@ static void wavpack_dispose (audio_decoder_t *this_gen) { } static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) { - wavpack_decoder_t * const this = (wavpack_decoder_t *) xine_xmalloc (sizeof (wavpack_decoder_t)); + wavpack_decoder_t * const this = calloc(1, sizeof (wavpack_decoder_t)); this->audio_decoder.decode_data = wavpack_decode_data; this->audio_decoder.reset = wavpack_reset; @@ -324,7 +324,7 @@ static void dispose_class (audio_decoder_class_t *this) { void *decoder_wavpack_init_plugin (xine_t *xine, void *data) { wavpack_class_t *this; - this = (wavpack_class_t *) xine_xmalloc (sizeof (wavpack_class_t)); + this = calloc(1, sizeof (wavpack_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/combined/demux_flac.c b/src/combined/demux_flac.c index fdc7ab7ea..ebba63701 100644 --- a/src/combined/demux_flac.c +++ b/src/combined/demux_flac.c @@ -607,7 +607,7 @@ open_plugin (demux_class_t *class_gen, * if we reach this point, the input has been accepted. */ - this = xine_xmalloc (sizeof (demux_flac_t)); + this = calloc(1, sizeof (demux_flac_t)); this->stream = stream; this->input = input; @@ -752,7 +752,7 @@ demux_flac_init_class (xine_t *xine, void *data) { lprintf("demux_flac_init_class\n"); - this = xine_xmalloc (sizeof (demux_flac_class_t)); + this = calloc(1, sizeof (demux_flac_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/combined/demux_wavpack.c b/src/combined/demux_wavpack.c index 754052199..2c3e6ce55 100644 --- a/src/combined/demux_wavpack.c +++ b/src/combined/demux_wavpack.c @@ -332,7 +332,7 @@ static int demux_wv_get_optional_data(demux_plugin_t *const this_gen, static demux_plugin_t *open_plugin (demux_class_t *const class_gen, xine_stream_t *const stream, input_plugin_t *const input) { - demux_wv_t *const this = xine_xmalloc (sizeof (demux_wv_t)); + demux_wv_t *const this = calloc(1, sizeof (demux_wv_t)); this->stream = stream; this->input = input; @@ -401,7 +401,7 @@ static void class_dispose (demux_class_t *const this_gen) { } void *demux_wv_init_plugin (xine_t *const xine, void *const data) { - demux_wv_class_t *const this = xine_xmalloc (sizeof (demux_wv_class_t)); + demux_wv_class_t *const this = calloc(1, sizeof (demux_wv_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c index 042900867..de45cc1a2 100644 --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -178,7 +178,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->context->bit_rate = audio_header->nAvgBytesPerSec * 8; if(audio_header->cbSize > 0) { - this->context->extradata = xine_xmalloc(audio_header->cbSize); + this->context->extradata = malloc(audio_header->cbSize); this->context->extradata_size = audio_header->cbSize; memcpy( this->context->extradata, (uint8_t *)audio_header + sizeof(xine_waveformatex), @@ -203,7 +203,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->context->block_align = _X_BE_32(&this->buf[0x18]); this->context->extradata_size = 5*sizeof(short); - this->context->extradata = xine_xmalloc(this->context->extradata_size); + this->context->extradata = malloc(this->context->extradata_size); ptr = (short *) this->context->extradata; @@ -276,7 +276,7 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->size = 0; - this->decode_buffer = xine_xmalloc(AVCODEC_MAX_AUDIO_FRAME_SIZE); + this->decode_buffer = calloc(1, AVCODEC_MAX_AUDIO_FRAME_SIZE); return; } @@ -450,7 +450,7 @@ static audio_decoder_t *ff_audio_open_plugin (audio_decoder_class_t *class_gen, ff_audio_decoder_t *this ; - this = (ff_audio_decoder_t *) xine_xmalloc (sizeof (ff_audio_decoder_t)); + this = calloc(1, sizeof (ff_audio_decoder_t)); this->audio_decoder.decode_data = ff_audio_decode_data; this->audio_decoder.reset = ff_audio_reset; @@ -486,7 +486,7 @@ void *init_audio_plugin (xine_t *xine, void *data) { ff_audio_class_t *this ; - this = (ff_audio_class_t *) xine_xmalloc (sizeof (ff_audio_class_t)); + this = calloc(1, sizeof (ff_audio_class_t)); this->decoder_class.open_plugin = ff_audio_open_plugin; this->decoder_class.get_identifier = ff_audio_get_identifier; diff --git a/src/combined/ffmpeg/ff_dvaudio_decoder.c b/src/combined/ffmpeg/ff_dvaudio_decoder.c index 4704c1a2a..6a102f627 100644 --- a/src/combined/ffmpeg/ff_dvaudio_decoder.c +++ b/src/combined/ffmpeg/ff_dvaudio_decoder.c @@ -251,10 +251,10 @@ static void dvaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) return; if (buf->decoder_flags & BUF_FLAG_STDHEADER) { - this->buf = xine_xmalloc(AUDIOBUFSIZE); + this->buf = calloc(1, AUDIOBUFSIZE); this->bufsize = AUDIOBUFSIZE; this->size = 0; - this->decode_buffer = xine_xmalloc(MAXFRAMESIZE); + this->decode_buffer = calloc(1, MAXFRAMESIZE); this->audio_sample_rate = buf->decoder_info[1]; this->audio_bits = buf->decoder_info[2]; @@ -368,7 +368,7 @@ static audio_decoder_t *dvaudio_open_plugin (audio_decoder_class_t *class_gen, x dvaudio_decoder_t *this ; - this = (dvaudio_decoder_t *) xine_xmalloc (sizeof (dvaudio_decoder_t)); + this = calloc(1, sizeof (dvaudio_decoder_t)); this->audio_decoder.decode_data = dvaudio_decode_data; this->audio_decoder.reset = dvaudio_reset; @@ -401,7 +401,7 @@ static void *init_dvaudio_plugin (xine_t *xine, void *data) { dvaudio_class_t *this ; - this = (dvaudio_class_t *) xine_xmalloc (sizeof (dvaudio_class_t)); + this = calloc(1, sizeof (dvaudio_class_t)); this->decoder_class.open_plugin = dvaudio_open_plugin; this->decoder_class.get_identifier = dvaudio_get_identifier; diff --git a/src/combined/ffmpeg/ff_mpeg_parser.c b/src/combined/ffmpeg/ff_mpeg_parser.c index 70901d93b..3c2c2cf48 100644 --- a/src/combined/ffmpeg/ff_mpeg_parser.c +++ b/src/combined/ffmpeg/ff_mpeg_parser.c @@ -50,7 +50,7 @@ static const int frame_rate_tab[][2] = { void mpeg_parser_init (mpeg_parser_t *parser) { - parser->chunk_buffer = xine_xmalloc(BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); + parser->chunk_buffer = malloc(BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE); mpeg_parser_reset(parser); } diff --git a/src/combined/ffmpeg/ff_video_decoder.c b/src/combined/ffmpeg/ff_video_decoder.c index 485e84afb..3ea08417e 100644 --- a/src/combined/ffmpeg/ff_video_decoder.c +++ b/src/combined/ffmpeg/ff_video_decoder.c @@ -895,7 +895,7 @@ static void ff_handle_preview_buffer (ff_video_decoder_t *this, buf_element_t *b if (codec_type == BUF_VIDEO_MPEG) { this->is_mpeg12 = 1; if ( this->mpeg_parser == NULL ) { - this->mpeg_parser = xine_xmalloc(sizeof(mpeg_parser_t)); + this->mpeg_parser = calloc(1, sizeof(mpeg_parser_t)); mpeg_parser_init(this->mpeg_parser); this->decoder_init_mode = 0; } @@ -950,7 +950,7 @@ static void ff_handle_header_buffer (ff_video_decoder_t *this, buf_element_t *bu this->context->sub_id = _X_BE_32(&this->buf[30]); - this->context->slice_offset = xine_xmalloc(sizeof(int)*SLICE_OFFSET_SIZE); + this->context->slice_offset = calloc(SLICE_OFFSET_SIZE, sizeof(int)); this->slice_offset_size = SLICE_OFFSET_SIZE; this->context->extradata_size = this->size - 26; @@ -998,8 +998,8 @@ static void ff_handle_special_buffer (ff_video_decoder_t *this, buf_element_t *b lprintf("BUF_SPECIAL_STSD_ATOM\n"); this->context->extradata_size = buf->decoder_info[2]; - this->context->extradata = xine_xmalloc(buf->decoder_info[2] + - FF_INPUT_BUFFER_PADDING_SIZE); + this->context->extradata = malloc(buf->decoder_info[2] + + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(this->context->extradata, buf->decoder_info_ptr[2], buf->decoder_info[2]); @@ -1008,8 +1008,8 @@ static void ff_handle_special_buffer (ff_video_decoder_t *this, buf_element_t *b lprintf("BUF_SPECIAL_DECODER_CONFIG\n"); this->context->extradata_size = buf->decoder_info[2]; - this->context->extradata = xine_xmalloc(buf->decoder_info[2] + - FF_INPUT_BUFFER_PADDING_SIZE); + this->context->extradata = malloc(buf->decoder_info[2] + + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(this->context->extradata, buf->decoder_info_ptr[2], buf->decoder_info[2]); @@ -1557,7 +1557,7 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen, lprintf ("open_plugin\n"); - this = (ff_video_decoder_t *) xine_xmalloc (sizeof (ff_video_decoder_t)); + this = calloc(1, sizeof (ff_video_decoder_t)); this->video_decoder.decode_data = ff_decode_data; this->video_decoder.flush = ff_flush; @@ -1576,7 +1576,7 @@ static video_decoder_t *ff_video_open_plugin (video_decoder_class_t *class_gen, this->decoder_ok = 0; this->decoder_init_mode = 1; - this->buf = xine_xmalloc(VIDEOBUFSIZE + FF_INPUT_BUFFER_PADDING_SIZE); + this->buf = calloc(1, VIDEOBUFSIZE + FF_INPUT_BUFFER_PADDING_SIZE); this->bufsize = VIDEOBUFSIZE; this->is_mpeg12 = 0; @@ -1614,7 +1614,7 @@ void *init_video_plugin (xine_t *xine, void *data) { ff_video_class_t *this; config_values_t *config; - this = (ff_video_class_t *) xine_xmalloc (sizeof (ff_video_class_t)); + this = calloc(1, sizeof (ff_video_class_t)); this->decoder_class.open_plugin = ff_video_open_plugin; this->decoder_class.get_identifier = ff_video_get_identifier; diff --git a/src/combined/ffmpeg/ffmpeg_encoder.c b/src/combined/ffmpeg/ffmpeg_encoder.c index 2d1be10a3..84243a56f 100644 --- a/src/combined/ffmpeg/ffmpeg_encoder.c +++ b/src/combined/ffmpeg/ffmpeg_encoder.c @@ -78,7 +78,7 @@ int dxr3_encoder_init(dxr3_driver_t *drv) avcodec_register_all(); lprintf("lavc init , version %x\n", avcodec_version()); - this = xine_xmalloc(sizeof(lavc_data_t)); + this = calloc(1, sizeof(lavc_data_t)); if (!this) return 0; this->encoder_data.type = ENC_LAVC; diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c index b06651456..a5fcd6568 100644 --- a/src/demuxers/demux_4xm.c +++ b/src/demuxers/demux_4xm.c @@ -472,7 +472,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_fourxm_t *this; - this = xine_xmalloc (sizeof (demux_fourxm_t)); + this = calloc(1, sizeof(demux_fourxm_t)); this->stream = stream; this->input = input; @@ -546,7 +546,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_fourxm_init_plugin (xine_t *xine, void *data) { demux_fourxm_class_t *this; - this = xine_xmalloc (sizeof (demux_fourxm_class_t)); + this = calloc(1, sizeof(demux_fourxm_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_aac.c b/src/demuxers/demux_aac.c index d80413f83..63c787bc7 100644 --- a/src/demuxers/demux_aac.c +++ b/src/demuxers/demux_aac.c @@ -262,7 +262,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_aac_t *this; - this = xine_xmalloc (sizeof (demux_aac_t)); + this = calloc(1, sizeof(demux_aac_t)); this->stream = stream; this->input = input; @@ -333,7 +333,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_aac_init_plugin (xine_t *xine, void *data) { demux_aac_class_t *this; - this = xine_xmalloc (sizeof (demux_aac_class_t)); + this = calloc(1, sizeof(demux_aac_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_ac3.c b/src/demuxers/demux_ac3.c index c0fae275b..85852b33a 100644 --- a/src/demuxers/demux_ac3.c +++ b/src/demuxers/demux_ac3.c @@ -417,7 +417,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_ac3_t *this; - this = xine_xmalloc (sizeof (demux_ac3_t)); + this = calloc(1, sizeof(demux_ac3_t)); this->stream = stream; this->input = input; @@ -491,7 +491,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_ac3_init_plugin (xine_t *xine, void *data) { demux_ac3_class_t *this; - this = xine_xmalloc (sizeof (demux_ac3_class_t)); + this = calloc(1, sizeof(demux_ac3_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_aiff.c b/src/demuxers/demux_aiff.c index b33b649a5..6f8953a90 100644 --- a/src/demuxers/demux_aiff.c +++ b/src/demuxers/demux_aiff.c @@ -369,7 +369,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_aiff_t *this; - this = xine_xmalloc (sizeof (demux_aiff_t)); + this = calloc(1, sizeof(demux_aiff_t)); this->stream = stream; this->input = input; @@ -445,7 +445,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_aiff_init_plugin (xine_t *xine, void *data) { demux_aiff_class_t *this; - this = xine_xmalloc (sizeof (demux_aiff_class_t)); + this = calloc(1, sizeof(demux_aiff_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_asf.c b/src/demuxers/demux_asf.c index 4eb9398be..2b8114a0d 100644 --- a/src/demuxers/demux_asf.c +++ b/src/demuxers/demux_asf.c @@ -2073,7 +2073,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, return NULL; } - this = xine_xmalloc (sizeof (demux_asf_t)); + this = calloc(1, sizeof(demux_asf_t)); this->stream = stream; this->input = input; @@ -2148,7 +2148,7 @@ static void *init_class (xine_t *xine, void *data) { demux_asf_class_t *this; - this = xine_xmalloc (sizeof (demux_asf_class_t)); + this = calloc(1, sizeof(demux_asf_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/demuxers/demux_aud.c b/src/demuxers/demux_aud.c index a6f88ff48..b99c67806 100644 --- a/src/demuxers/demux_aud.c +++ b/src/demuxers/demux_aud.c @@ -270,7 +270,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_aud_t *this; - this = xine_xmalloc (sizeof (demux_aud_t)); + this = calloc(1, sizeof(demux_aud_t)); this->stream = stream; this->input = input; @@ -343,7 +343,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_aud_init_plugin (xine_t *xine, void *data) { demux_aud_class_t *this; - this = xine_xmalloc (sizeof (demux_aud_class_t)); + this = calloc(1, sizeof(demux_aud_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 656e4662a..01efe0e53 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -739,7 +739,7 @@ static avi_t *AVI_init(demux_avi_t *this) { /* Create avi_t structure */ lprintf("start\n"); - AVI = (avi_t *) xine_xmalloc(sizeof(avi_t)); + AVI = (avi_t *) calloc(1, sizeof(avi_t)); if(AVI==NULL) { this->AVI_errno = AVI_ERR_NO_MEM; return 0; @@ -877,7 +877,7 @@ static avi_t *AVI_init(demux_avi_t *this) { } else if (strncasecmp (hdrl_data+i,"auds",4) ==0 /* && ! auds_strh_seen*/) { if(AVI->n_audio < MAX_AUDIO_STREAMS) { - avi_audio_t *a = (avi_audio_t *) xine_xmalloc(sizeof(avi_audio_t)); + avi_audio_t *a = (avi_audio_t *) calloc(1, sizeof(avi_audio_t)); if(a==NULL) { this->AVI_errno = AVI_ERR_NO_MEM; return 0; @@ -2281,7 +2281,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_avi_t)); + this = calloc(1, sizeof(demux_avi_t)); this->stream = stream; this->input = input; @@ -2347,7 +2347,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_class (xine_t *xine, void *data) { demux_avi_class_t *this; - this = xine_xmalloc (sizeof (demux_avi_class_t)); + this = calloc(1, sizeof(demux_avi_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_cdda.c b/src/demuxers/demux_cdda.c index 0f34a7cec..8e9ad3679 100644 --- a/src/demuxers/demux_cdda.c +++ b/src/demuxers/demux_cdda.c @@ -187,7 +187,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_cdda_t *this; - this = xine_xmalloc (sizeof (demux_cdda_t)); + this = calloc(1, sizeof(demux_cdda_t)); this->stream = stream; this->input = input; @@ -250,7 +250,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_cdda_init_plugin (xine_t *xine, void *data) { demux_cdda_class_t *this; - this = xine_xmalloc (sizeof (demux_cdda_class_t)); + this = calloc(1, sizeof(demux_cdda_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_dts.c b/src/demuxers/demux_dts.c index c99a0688a..1b276c600 100644 --- a/src/demuxers/demux_dts.c +++ b/src/demuxers/demux_dts.c @@ -392,7 +392,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_dts_t *this; - this = xine_xmalloc (sizeof (demux_dts_t)); + this = calloc(1, sizeof(demux_dts_t)); this->stream = stream; this->input = input; @@ -464,7 +464,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_dts_init_plugin (xine_t *xine, void *data) { demux_dts_class_t *this; - this = xine_xmalloc (sizeof (demux_dts_class_t)); + this = calloc(1, sizeof(demux_dts_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_eawve.c b/src/demuxers/demux_eawve.c index 2359d3baf..58ce4520f 100644 --- a/src/demuxers/demux_eawve.c +++ b/src/demuxers/demux_eawve.c @@ -349,7 +349,7 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre if (!INPUT_IS_SEEKABLE(input)) return NULL; - this = xine_xmalloc(sizeof(demux_eawve_t)); + this = calloc(1, sizeof(demux_eawve_t)); this->stream = stream; this->input = input; @@ -421,7 +421,7 @@ static void class_dispose(demux_class_t *this){ void *demux_eawve_init_plugin(xine_t *xine, void *data) { demux_eawve_class_t *this; - this = xine_xmalloc(sizeof(demux_eawve_class_t)); + this = calloc(1, sizeof(demux_eawve_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_elem.c b/src/demuxers/demux_elem.c index d0a821504..a66befe01 100644 --- a/src/demuxers/demux_elem.c +++ b/src/demuxers/demux_elem.c @@ -240,7 +240,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_mpeg_elem_t)); + this = calloc(1, sizeof(demux_mpeg_elem_t)); this->stream = stream; this->input = input; @@ -284,7 +284,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_mpeg_elem_class_t *this; - this = xine_xmalloc (sizeof (demux_mpeg_elem_class_t)); + this = calloc(1, sizeof(demux_mpeg_elem_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 60365ab4d..7abbf7134 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -858,7 +858,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_film_t *this; - this = xine_xmalloc (sizeof (demux_film_t)); + this = calloc(1, sizeof(demux_film_t)); this->stream = stream; this->input = input; @@ -932,7 +932,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_film_init_plugin (xine_t *xine, void *data) { demux_film_class_t *this; - this = xine_xmalloc (sizeof (demux_film_class_t)); + this = calloc(1, sizeof(demux_film_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c index b4c5edb2d..e6d6f6376 100644 --- a/src/demuxers/demux_flac.c +++ b/src/demuxers/demux_flac.c @@ -491,7 +491,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_flac_t)); + this = calloc(1, sizeof(demux_flac_t)); this->stream = stream; this->input = input; @@ -566,7 +566,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_flac_init_plugin (xine_t *xine, void *data) { demux_flac_class_t *this; - this = xine_xmalloc (sizeof (demux_flac_class_t)); + this = calloc(1, sizeof(demux_flac_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_fli.c b/src/demuxers/demux_fli.c index 99843a68c..fabc2c788 100644 --- a/src/demuxers/demux_fli.c +++ b/src/demuxers/demux_fli.c @@ -303,7 +303,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_fli_t *this; - this = xine_xmalloc (sizeof (demux_fli_t)); + this = calloc(1, sizeof(demux_fli_t)); this->stream = stream; this->input = input; @@ -377,7 +377,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_fli_class_t *this; - this = xine_xmalloc (sizeof (demux_fli_class_t)); + this = calloc(1, sizeof(demux_fli_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c index 0d18783c2..d319ece74 100644 --- a/src/demuxers/demux_flv.c +++ b/src/demuxers/demux_flv.c @@ -365,7 +365,7 @@ static int parse_flv_var(demux_flv_t *this, } static void parse_flv_script(demux_flv_t *this, int size) { - unsigned char *buf = xine_xmalloc(size); + unsigned char *buf = malloc(size); unsigned char *tmp = buf; unsigned char *end = buf + size; int len; @@ -856,7 +856,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str input_plugin_t *input) { demux_flv_t *this; - this = xine_xmalloc(sizeof (demux_flv_t)); + this = calloc(1, sizeof(demux_flv_t)); this->xine = stream->xine; this->stream = stream; this->input = input; @@ -924,7 +924,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_flv_class_t *this; - this = xine_xmalloc (sizeof (demux_flv_class_t)); + this = calloc(1, sizeof(demux_flv_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_idcin.c b/src/demuxers/demux_idcin.c index 99754c797..d44f03ab3 100644 --- a/src/demuxers/demux_idcin.c +++ b/src/demuxers/demux_idcin.c @@ -472,7 +472,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_idcin_t *this; - this = xine_xmalloc (sizeof (demux_idcin_t)); + this = calloc(1, sizeof(demux_idcin_t)); this->stream = stream; this->input = input; @@ -547,7 +547,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_idcin_init_plugin (xine_t *xine, void *data) { demux_idcin_class_t *this; - this = xine_xmalloc (sizeof (demux_idcin_class_t)); + this = calloc(1, sizeof(demux_idcin_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c index 0856eec1a..d43eebf22 100644 --- a/src/demuxers/demux_iff.c +++ b/src/demuxers/demux_iff.c @@ -212,7 +212,7 @@ static int read_iff_chunk(demux_iff_t *this) { break; case IFF_VHDR_CHUNK: if( this->vhdr == NULL ) - this->vhdr = (Voice8Header *)xine_xmalloc(sizeof(Voice8Header)); + this->vhdr = (Voice8Header *)calloc(1, sizeof(Voice8Header)); this->vhdr->oneShotHiSamples = _X_BE_32(&buffer[0]); this->vhdr->repeatHiSamples = _X_BE_32(&buffer[4]); this->vhdr->samplesPerHiCycle = _X_BE_32(&buffer[8]); @@ -330,7 +330,7 @@ static int read_iff_chunk(demux_iff_t *this) { break; case IFF_BMHD_CHUNK: if( this->bmhd == NULL ) - this->bmhd = (BitMapHeader *)xine_xmalloc(sizeof(BitMapHeader)); + this->bmhd = (BitMapHeader *)calloc(1, sizeof(BitMapHeader)); this->bmhd->w = _X_BE_16(&buffer[0]); this->bmhd->h = _X_BE_16(&buffer[2]); this->bmhd->x = _X_BE_16(&buffer[4]); @@ -406,13 +406,13 @@ static int read_iff_chunk(demux_iff_t *this) { break; case IFF_GRAB_CHUNK: if( this->grab == NULL ) - this->grab = (Point2D *)xine_xmalloc(sizeof(Point2D)); + this->grab = (Point2D *)calloc(1, sizeof(Point2D)); this->grab->x = _X_BE_16(&buffer[0]); this->grab->y = _X_BE_16(&buffer[2]); break; case IFF_DEST_CHUNK: if( this->dest == NULL ) - this->dest = (DestMerge *)xine_xmalloc(sizeof(DestMerge)); + this->dest = (DestMerge *)calloc(1, sizeof(DestMerge)); this->dest->depth = buffer[0]; this->dest->pad1 = buffer[1]; this->dest->plane_pick = _X_BE_16(&buffer[2]); @@ -424,7 +424,7 @@ static int read_iff_chunk(demux_iff_t *this) { break; case IFF_CAMG_CHUNK: if( this->camg == NULL ) - this->camg = (CamgChunk *)xine_xmalloc(sizeof(CamgChunk)); + this->camg = (CamgChunk *)calloc(1, sizeof(CamgChunk)); this->camg->view_modes = _X_BE_32(&buffer[0]); this->bih.biCompression = this->camg->view_modes; if( this->camg->view_modes & CAMG_PAL && @@ -443,7 +443,7 @@ static int read_iff_chunk(demux_iff_t *this) { break; case IFF_CCRT_CHUNK: if( this->ccrt == NULL ) - this->ccrt = (CcrtChunk *)xine_xmalloc(sizeof(CcrtChunk)); + this->ccrt = (CcrtChunk *)calloc(1, sizeof(CcrtChunk)); this->ccrt->direction = _X_BE_16(&buffer[0]); this->ccrt->start = buffer[2]; this->ccrt->end = buffer[3]; @@ -453,13 +453,13 @@ static int read_iff_chunk(demux_iff_t *this) { break; case IFF_DPI_CHUNK: if( this->dpi == NULL ) - this->dpi = (DPIHeader *)xine_xmalloc(sizeof(DPIHeader)); + this->dpi = (DPIHeader *)calloc(1, sizeof(DPIHeader)); this->dpi->x = _X_BE_16(&buffer[0]); this->dpi->y = _X_BE_16(&buffer[0]); break; case IFF_ANHD_CHUNK: if( this->anhd == NULL ) - this->anhd = (AnimHeader *)xine_xmalloc(sizeof(AnimHeader)); + this->anhd = (AnimHeader *)calloc(1, sizeof(AnimHeader)); this->anhd->operation = buffer[0]; this->anhd->mask = buffer[1]; this->anhd->w = _X_BE_16(&buffer[2]); @@ -500,7 +500,7 @@ static int read_iff_chunk(demux_iff_t *this) { break; case IFF_DPAN_CHUNK: if( this->dpan == NULL ) - this->dpan = (DPAnimChunk *)xine_xmalloc(sizeof(DPAnimChunk)); + this->dpan = (DPAnimChunk *)calloc(1, sizeof(DPAnimChunk)); this->dpan->version = _X_BE_16(&buffer[0]); this->dpan->nframes = _X_BE_16(&buffer[2]); this->dpan->fps = buffer[4]; @@ -1242,7 +1242,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_iff_t *this; - this = xine_xmalloc (sizeof (demux_iff_t)); + this = calloc(1, sizeof(demux_iff_t)); this->stream = stream; this->input = input; @@ -1323,7 +1323,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_iff_class_t *this; - this = xine_xmalloc (sizeof (demux_iff_class_t)); + this = calloc(1, sizeof(demux_iff_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_image.c b/src/demuxers/demux_image.c index 9f53e4173..feaf3ceaa 100644 --- a/src/demuxers/demux_image.c +++ b/src/demuxers/demux_image.c @@ -198,7 +198,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, * if we reach this point, the input has been accepted. */ - this = xine_xmalloc (sizeof (demux_image_t)); + this = calloc(1, sizeof(demux_image_t)); this->stream = stream; this->input = input; @@ -249,7 +249,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_class (xine_t *xine, void *data) { demux_image_class_t *this; - this = xine_xmalloc (sizeof (demux_image_class_t)); + this = calloc(1, sizeof(demux_image_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_ipmovie.c b/src/demuxers/demux_ipmovie.c index 12640e662..4ef877988 100644 --- a/src/demuxers/demux_ipmovie.c +++ b/src/demuxers/demux_ipmovie.c @@ -672,7 +672,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_ipmovie_t *this; - this = xine_xmalloc (sizeof (demux_ipmovie_t)); + this = calloc(1, sizeof(demux_ipmovie_t)); this->stream = stream; this->input = input; @@ -747,7 +747,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_ipmovie_init_plugin (xine_t *xine, void *data) { demux_ipmovie_class_t *this; - this = xine_xmalloc (sizeof (demux_ipmovie_class_t)); + this = calloc(1, sizeof(demux_ipmovie_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 942a6613e..b05128fec 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -1210,7 +1210,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) { lprintf("Video\n"); if (track->video_track) return 1; - track->video_track = (matroska_video_track_t *)xine_xmalloc(sizeof(matroska_video_track_t)); + track->video_track = (matroska_video_track_t *)calloc(1, sizeof(matroska_video_track_t)); if (!ebml_read_master (ebml, &elem)) return 0; if ((elem.len > 0) && !parse_video_track(this, track->video_track)) @@ -1221,7 +1221,7 @@ static int parse_track_entry(demux_matroska_t *this, matroska_track_t *track) { lprintf("Audio\n"); if (track->audio_track) return 1; - track->audio_track = (matroska_audio_track_t *)xine_xmalloc(sizeof(matroska_audio_track_t)); + track->audio_track = (matroska_audio_track_t *)calloc(1, sizeof(matroska_audio_track_t)); if (!ebml_read_master (ebml, &elem)) return 0; if ((elem.len > 0) && !parse_audio_track(this, track->audio_track)) @@ -1511,7 +1511,7 @@ static int parse_tracks(demux_matroska_t *this) { matroska_track_t *track; /* alloc and initialize a track with 0 */ - track = xine_xmalloc(sizeof(matroska_track_t)); + track = calloc(1, sizeof(matroska_track_t)); track->compress_algo = MATROSKA_COMPRESS_NONE; this->tracks[this->num_tracks] = track; @@ -2853,7 +2853,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_matroska_t)); + this = calloc(1, sizeof(demux_matroska_t)); this->demux_plugin.send_headers = demux_matroska_send_headers; this->demux_plugin.send_chunk = demux_matroska_send_chunk; @@ -2929,7 +2929,7 @@ static void *init_class (xine_t *xine, void *data) { demux_matroska_class_t *this; - this = xine_xmalloc (sizeof (demux_matroska_class_t)); + this = calloc(1, sizeof(demux_matroska_class_t)); this->xine = xine; this->demux_class.open_plugin = open_plugin; diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c index 12da8ca86..a32374048 100644 --- a/src/demuxers/demux_mng.c +++ b/src/demuxers/demux_mng.c @@ -260,7 +260,7 @@ static demux_plugin_t* open_plugin(demux_class_t *class_gen, xine_stream_t *stre demux_mng_t *this; - this = xine_xmalloc (sizeof (demux_mng_t)); + this = calloc(1, sizeof(demux_mng_t)); this->stream = stream; this->input = input; @@ -360,7 +360,7 @@ static void class_dispose(demux_class_t *this){ static void *init_plugin(xine_t *xine, void *data){ demux_mng_class_t *this; - this = xine_xmalloc (sizeof (demux_mng_class_t)); + this = calloc(1, sizeof(demux_mng_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c index e7c6f86b3..2c0f44afa 100644 --- a/src/demuxers/demux_mod.c +++ b/src/demuxers/demux_mod.c @@ -305,7 +305,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_mod_t)); + this = calloc(1, sizeof(demux_mod_t)); this->stream = stream; this->input = input; @@ -380,7 +380,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_mod_init_plugin (xine_t *xine, void *data) { demux_mod_class_t *this; - this = xine_xmalloc (sizeof (demux_mod_class_t)); + this = calloc(1, sizeof(demux_mod_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_mpc.c b/src/demuxers/demux_mpc.c index a3791811e..e00a50ea3 100644 --- a/src/demuxers/demux_mpc.c +++ b/src/demuxers/demux_mpc.c @@ -324,7 +324,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_mpc_t *this; - this = xine_xmalloc (sizeof (demux_mpc_t)); + this = calloc(1, sizeof(demux_mpc_t)); this->stream = stream; this->input = input; @@ -398,7 +398,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_mpc_init_plugin (xine_t *xine, void *data) { demux_mpc_class_t *this; - this = xine_xmalloc (sizeof (demux_mpc_class_t)); + this = calloc(1, sizeof(demux_mpc_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 4419f8404..388be2140 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -1067,7 +1067,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str input_plugin_t *input) { demux_mpeg_t *this; - this = xine_xmalloc (sizeof (demux_mpeg_t)); + this = calloc(1, sizeof(demux_mpeg_t)); this->stream = stream; this->input = input; @@ -1246,7 +1246,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_mpeg_class_t *this; - this = xine_xmalloc (sizeof (demux_mpeg_class_t)); + this = calloc(1, sizeof(demux_mpeg_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_mpeg_block.c b/src/demuxers/demux_mpeg_block.c index 32638129d..3ecb88d04 100644 --- a/src/demuxers/demux_mpeg_block.c +++ b/src/demuxers/demux_mpeg_block.c @@ -1371,7 +1371,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str input_plugin_t *input = (input_plugin_t *) input_gen; demux_mpeg_block_t *this; - this = xine_xmalloc (sizeof (demux_mpeg_block_t)); + this = calloc(1, sizeof(demux_mpeg_block_t)); this->stream = stream; this->input = input; @@ -1540,7 +1540,7 @@ static void *init_plugin (xine_t *xine, void *data) { demux_mpeg_block_class_t *this; - this = xine_xmalloc (sizeof (demux_mpeg_block_class_t)); + this = calloc(1, sizeof(demux_mpeg_block_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/demuxers/demux_mpeg_pes.c b/src/demuxers/demux_mpeg_pes.c index 423da5e24..477a071a4 100644 --- a/src/demuxers/demux_mpeg_pes.c +++ b/src/demuxers/demux_mpeg_pes.c @@ -1613,7 +1613,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str input_plugin_t *input = (input_plugin_t *) input_gen; demux_mpeg_pes_t *this; - this = xine_xmalloc (sizeof (demux_mpeg_pes_t)); + this = calloc(1, sizeof(demux_mpeg_pes_t)); this->stream = stream; this->input = input; @@ -1786,7 +1786,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_mpeg_pes_class_t *this; - this = xine_xmalloc (sizeof (demux_mpeg_pes_class_t)); + this = calloc(1, sizeof(demux_mpeg_pes_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c index c7af1c508..a32063515 100644 --- a/src/demuxers/demux_mpgaudio.c +++ b/src/demuxers/demux_mpgaudio.c @@ -341,7 +341,7 @@ static xing_header_t* parse_xing_header(mpg_audio_frame_t *frame, int has_frames_flag = 0; int has_bytes_flag = 0; - xing = xine_xmalloc (sizeof (xing_header_t)); + xing = calloc(1, sizeof(xing_header_t)); if (!xing) goto exit_error; @@ -427,7 +427,7 @@ static vbri_header_t* parse_vbri_header(mpg_audio_frame_t *frame, uint8_t *ptr = buf; vbri_header_t *vbri; - vbri = xine_xmalloc (sizeof (vbri_header_t)); + vbri = calloc(1, sizeof(vbri_header_t)); if (!vbri) return NULL; @@ -1148,7 +1148,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_mpgaudio_t)); + this = calloc(1, sizeof(demux_mpgaudio_t)); this->demux_plugin.send_headers = demux_mpgaudio_send_headers; this->demux_plugin.send_chunk = demux_mpgaudio_send_chunk; @@ -1223,7 +1223,7 @@ void *demux_mpgaudio_init_class (xine_t *xine, void *data) { demux_mpgaudio_class_t *this; - this = xine_xmalloc (sizeof (demux_mpgaudio_class_t)); + this = calloc(1, sizeof(demux_mpgaudio_class_t)); this->xine = xine; this->demux_class.open_plugin = open_plugin; diff --git a/src/demuxers/demux_nsf.c b/src/demuxers/demux_nsf.c index d81010846..557adf28d 100644 --- a/src/demuxers/demux_nsf.c +++ b/src/demuxers/demux_nsf.c @@ -303,7 +303,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_nsf_t)); + this = calloc(1, sizeof(demux_nsf_t)); this->stream = stream; this->input = input; @@ -377,7 +377,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_nsf_init_plugin (xine_t *xine, void *data) { demux_nsf_class_t *this; - this = xine_xmalloc (sizeof (demux_nsf_class_t)); + this = calloc(1, sizeof(demux_nsf_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_nsv.c b/src/demuxers/demux_nsv.c index 44bb18c79..71046b039 100644 --- a/src/demuxers/demux_nsv.c +++ b/src/demuxers/demux_nsv.c @@ -594,7 +594,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_nsv_t *this; - this = xine_xmalloc (sizeof (demux_nsv_t)); + this = calloc(1, sizeof(demux_nsv_t)); this->stream = stream; this->input = input; @@ -668,7 +668,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *demux_nsv_init_plugin (xine_t *xine, void *data) { demux_nsv_class_t *this; - this = xine_xmalloc (sizeof (demux_nsv_class_t)); + this = calloc(1, sizeof(demux_nsv_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_ogg.c b/src/demuxers/demux_ogg.c index 33c262793..c8c39c991 100644 --- a/src/demuxers/demux_ogg.c +++ b/src/demuxers/demux_ogg.c @@ -194,7 +194,7 @@ static int get_stream (demux_ogg_t *this, int serno) { static int new_stream_info (demux_ogg_t *this, const int cur_serno) { int stream_num; - this->si[this->num_streams] = (stream_info_t *)xine_xmalloc(sizeof(stream_info_t)); + this->si[this->num_streams] = (stream_info_t *)calloc(1, sizeof(stream_info_t)); ogg_stream_init(&this->si[this->num_streams]->oss, cur_serno); stream_num = this->num_streams; this->si[stream_num]->buf_types = 0; @@ -498,7 +498,7 @@ static void read_chapter_comment (demux_ogg_t *this, ogg_packet *op) { lprintf("time: %d %d %d %d\n", hour, min,sec,msec); if (!this->chapter_info) { - this->chapter_info = (chapter_info_t *)xine_xmalloc(sizeof(chapter_info_t)); + this->chapter_info = (chapter_info_t *)calloc(1, sizeof(chapter_info_t)); this->chapter_info->current_chapter = -1; } this->chapter_info->max_chapter = chapter_no; @@ -2026,7 +2026,7 @@ static demux_plugin_t *anx_open_plugin (demux_class_t *class_gen, * if we reach this point, the input has been accepted. */ - this = xine_xmalloc (sizeof (demux_ogg_t)); + this = calloc(1, sizeof(demux_ogg_t)); memset (this, 0, sizeof(demux_ogg_t)); this->stream = stream; this->input = input; @@ -2072,7 +2072,7 @@ static demux_plugin_t *ogg_open_plugin (demux_class_t *class_gen, * if we reach this point, the input has been accepted. */ - this = xine_xmalloc (sizeof (demux_ogg_t)); + this = calloc(1, sizeof(demux_ogg_t)); memset (this, 0, sizeof(demux_ogg_t)); this->stream = stream; this->input = input; @@ -2135,7 +2135,7 @@ static void anx_class_dispose (demux_class_t *this_gen) { static void *anx_init_class (xine_t *xine, void *data) { demux_anx_class_t *this; - this = xine_xmalloc (sizeof (demux_anx_class_t)); + this = calloc(1, sizeof(demux_anx_class_t)); this->demux_class.open_plugin = anx_open_plugin; this->demux_class.get_description = anx_get_description; @@ -2184,7 +2184,7 @@ static void ogg_class_dispose (demux_class_t *this_gen) { static void *ogg_init_class (xine_t *xine, void *data) { demux_ogg_class_t *this; - this = xine_xmalloc (sizeof (demux_ogg_class_t)); + this = calloc(1, sizeof(demux_ogg_class_t)); this->demux_class.open_plugin = ogg_open_plugin; this->demux_class.get_description = ogg_get_description; diff --git a/src/demuxers/demux_pva.c b/src/demuxers/demux_pva.c index 298d936b5..ddd32b63c 100644 --- a/src/demuxers/demux_pva.c +++ b/src/demuxers/demux_pva.c @@ -430,7 +430,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_pva_t)); + this = calloc(1, sizeof(demux_pva_t)); this->stream = stream; this->input = input; @@ -503,7 +503,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_pva_class_t *this; - this = xine_xmalloc (sizeof (demux_pva_class_t)); + this = calloc(1, sizeof(demux_pva_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c index fe3727176..525160dd2 100644 --- a/src/demuxers/demux_qt.c +++ b/src/demuxers/demux_qt.c @@ -581,7 +581,7 @@ static void find_moov_atom(input_plugin_t *input, off_t *moov_offset, static qt_info *create_qt_info(void) { qt_info *info; - info = (qt_info *)xine_xmalloc(sizeof(qt_info)); + info = (qt_info *)calloc(1, sizeof(qt_info)); if (!info) return NULL; @@ -2981,7 +2981,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_qt_t)); + this = calloc(1, sizeof(demux_qt_t)); this->stream = stream; this->input = input; @@ -3110,7 +3110,7 @@ static void *init_plugin (xine_t *xine, void *data) { demux_qt_class_t *this; - this = xine_xmalloc (sizeof (demux_qt_class_t)); + this = calloc(1, sizeof(demux_qt_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/demuxers/demux_rawdv.c b/src/demuxers/demux_rawdv.c index 2d21f080d..848f871c8 100644 --- a/src/demuxers/demux_rawdv.c +++ b/src/demuxers/demux_rawdv.c @@ -347,7 +347,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_raw_dv_t *this; - this = xine_xmalloc (sizeof (demux_raw_dv_t)); + this = calloc(1, sizeof(demux_raw_dv_t)); this->stream = stream; this->input = input; @@ -436,7 +436,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_raw_dv_class_t *this; - this = xine_xmalloc (sizeof (demux_raw_dv_class_t)); + this = calloc(1, sizeof(demux_raw_dv_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 6a1d24dba..ad5daf5ea 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -1756,7 +1756,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str } - this = xine_xmalloc (sizeof (demux_real_t)); + this = calloc(1, sizeof(demux_real_t)); this->stream = stream; this->input = input; @@ -1814,7 +1814,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_class (xine_t *xine, void *data) { demux_real_class_t *this; - this = xine_xmalloc (sizeof (demux_real_class_t)); + this = calloc(1, sizeof(demux_real_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index 87e564b8d..e34fe0857 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -396,7 +396,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_ra_t *this; - this = xine_xmalloc (sizeof (demux_ra_t)); + this = calloc(1, sizeof(demux_ra_t)); this->stream = stream; this->input = input; this->frame_buffer = NULL; @@ -471,7 +471,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_realaudio_init_plugin (xine_t *xine, void *data) { demux_ra_class_t *this; - this = xine_xmalloc (sizeof (demux_ra_class_t)); + this = calloc(1, sizeof(demux_ra_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_roq.c b/src/demuxers/demux_roq.c index 18edaea87..ea68609f2 100644 --- a/src/demuxers/demux_roq.c +++ b/src/demuxers/demux_roq.c @@ -411,7 +411,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_roq_t)); + this = calloc(1, sizeof(demux_roq_t)); this->stream = stream; this->input = input; @@ -485,7 +485,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_roq_init_plugin (xine_t *xine, void *data) { demux_roq_class_t *this; - this = xine_xmalloc (sizeof (demux_roq_class_t)); + this = calloc(1, sizeof(demux_roq_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_shn.c b/src/demuxers/demux_shn.c index 87324ab45..4d932305c 100644 --- a/src/demuxers/demux_shn.c +++ b/src/demuxers/demux_shn.c @@ -182,7 +182,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_shn_t *this; - this = xine_xmalloc (sizeof (demux_shn_t)); + this = calloc(1, sizeof(demux_shn_t)); this->stream = stream; this->input = input; @@ -253,7 +253,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_shn_init_plugin (xine_t *xine, void *data) { demux_shn_class_t *this; - this = xine_xmalloc (sizeof (demux_shn_class_t)); + this = calloc(1, sizeof(demux_shn_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_slave.c b/src/demuxers/demux_slave.c index 436d37579..c2d427d8c 100644 --- a/src/demuxers/demux_slave.c +++ b/src/demuxers/demux_slave.c @@ -331,7 +331,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_slave_t *this; static char slave_id_str[] = "master xine v1\n"; - this = xine_xmalloc (sizeof (demux_slave_t)); + this = calloc(1, sizeof(demux_slave_t)); switch (stream->content_detection_method) { @@ -414,7 +414,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_slave_class_t *this; - this = xine_xmalloc (sizeof (demux_slave_class_t)); + this = calloc(1, sizeof(demux_slave_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_smjpeg.c b/src/demuxers/demux_smjpeg.c index 899fbf7e3..8857f90fd 100644 --- a/src/demuxers/demux_smjpeg.c +++ b/src/demuxers/demux_smjpeg.c @@ -400,7 +400,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_smjpeg_t)); + this = calloc(1, sizeof(demux_smjpeg_t)); this->stream = stream; this->input = input; @@ -474,7 +474,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_smjpeg_init_plugin (xine_t *xine, void *data) { demux_smjpeg_class_t *this; - this = xine_xmalloc (sizeof (demux_smjpeg_class_t)); + this = calloc(1, sizeof(demux_smjpeg_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_snd.c b/src/demuxers/demux_snd.c index 0965a75ae..51a4315e5 100644 --- a/src/demuxers/demux_snd.c +++ b/src/demuxers/demux_snd.c @@ -318,7 +318,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_snd_t *this; - this = xine_xmalloc (sizeof (demux_snd_t)); + this = calloc(1, sizeof(demux_snd_t)); this->stream = stream; this->input = input; @@ -395,7 +395,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_snd_init_plugin (xine_t *xine, void *data) { demux_snd_class_t *this; - this = xine_xmalloc (sizeof (demux_snd_class_t)); + this = calloc(1, sizeof(demux_snd_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_str.c b/src/demuxers/demux_str.c index 2cf542014..97e025504 100644 --- a/src/demuxers/demux_str.c +++ b/src/demuxers/demux_str.c @@ -555,7 +555,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_str_t)); + this = calloc(1, sizeof(demux_str_t)); this->stream = stream; this->input = input; @@ -628,7 +628,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_str_init_plugin (xine_t *xine, void *data) { demux_str_class_t *this; - this = xine_xmalloc (sizeof (demux_str_class_t)); + this = calloc(1, sizeof(demux_str_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_ts.c b/src/demuxers/demux_ts.c index 3049b2367..c3b1c2bad 100644 --- a/src/demuxers/demux_ts.c +++ b/src/demuxers/demux_ts.c @@ -2237,7 +2237,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, * if we reach this point, the input has been accepted. */ - this = xine_xmalloc(sizeof(*this)); + this = calloc(1, sizeof(*this)); this->stream = stream; this->input = input; this->blockSize = PKT_SIZE; @@ -2328,7 +2328,7 @@ static void *init_class (xine_t *xine, void *data) { demux_ts_class_t *this; - this = xine_xmalloc (sizeof (demux_ts_class_t)); + this = calloc(1, sizeof(demux_ts_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c index f0dd2612e..8e0595bda 100644 --- a/src/demuxers/demux_tta.c +++ b/src/demuxers/demux_tta.c @@ -233,7 +233,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_tta_t *this; - this = xine_xmalloc (sizeof (demux_tta_t)); + this = calloc(1, sizeof(demux_tta_t)); this->stream = stream; this->input = input; @@ -307,7 +307,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_tta_init_plugin (xine_t *xine, void *data) { demux_tta_class_t *this; - this = xine_xmalloc (sizeof (demux_tta_class_t)); + this = calloc(1, sizeof(demux_tta_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_vmd.c b/src/demuxers/demux_vmd.c index 416e86f39..b81e4575e 100644 --- a/src/demuxers/demux_vmd.c +++ b/src/demuxers/demux_vmd.c @@ -421,7 +421,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_vmd_t *this; - this = xine_xmalloc (sizeof (demux_vmd_t)); + this = calloc(1, sizeof(demux_vmd_t)); this->stream = stream; this->input = input; @@ -495,7 +495,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_vmd_init_plugin (xine_t *xine, void *data) { demux_vmd_class_t *this; - this = xine_xmalloc (sizeof (demux_vmd_class_t)); + this = calloc(1, sizeof(demux_vmd_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_voc.c b/src/demuxers/demux_voc.c index 0439980f8..1d6277186 100644 --- a/src/demuxers/demux_voc.c +++ b/src/demuxers/demux_voc.c @@ -296,7 +296,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_voc_t *this; - this = xine_xmalloc (sizeof (demux_voc_t)); + this = calloc(1, sizeof(demux_voc_t)); this->stream = stream; this->input = input; @@ -370,7 +370,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_voc_init_plugin (xine_t *xine, void *data) { demux_voc_class_t *this; - this = xine_xmalloc (sizeof (demux_voc_class_t)); + this = calloc(1, sizeof(demux_voc_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_vox.c b/src/demuxers/demux_vox.c index 3ce2ad705..d646a756f 100644 --- a/src/demuxers/demux_vox.c +++ b/src/demuxers/demux_vox.c @@ -203,7 +203,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str return NULL; } - this = xine_xmalloc (sizeof (demux_vox_t)); + this = calloc(1, sizeof(demux_vox_t)); this->stream = stream; this->input = input; @@ -247,7 +247,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_vox_init_plugin (xine_t *xine, void *data) { demux_vox_class_t *this; - this = xine_xmalloc (sizeof (demux_vox_class_t)); + this = calloc(1, sizeof(demux_vox_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_vqa.c b/src/demuxers/demux_vqa.c index 40242476b..ae0fd8231 100644 --- a/src/demuxers/demux_vqa.c +++ b/src/demuxers/demux_vqa.c @@ -334,7 +334,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_vqa_t *this; - this = xine_xmalloc (sizeof (demux_vqa_t)); + this = calloc(1, sizeof(demux_vqa_t)); this->stream = stream; this->input = input; @@ -408,7 +408,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_vqa_init_plugin (xine_t *xine, void *data) { demux_vqa_class_t *this; - this = xine_xmalloc (sizeof (demux_vqa_class_t)); + this = calloc(1, sizeof(demux_vqa_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index dede27e11..b8d3a8229 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -357,7 +357,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_wav_t *this; uint32_t align; - this = xine_xmalloc (sizeof (demux_wav_t)); + this = calloc(1, sizeof(demux_wav_t)); this->stream = stream; this->input = input; @@ -443,7 +443,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_wav_init_plugin (xine_t *xine, void *data) { demux_wav_class_t *this; - this = xine_xmalloc (sizeof (demux_wav_class_t)); + this = calloc(1, sizeof(demux_wav_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index 61811c193..dab0d2619 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -674,7 +674,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_mve_t *this; - this = xine_xmalloc (sizeof (demux_mve_t)); + this = calloc(1, sizeof(demux_mve_t)); this->stream = stream; this->input = input; @@ -748,7 +748,7 @@ static void class_dispose (demux_class_t *this_gen) { void *demux_wc3movie_init_plugin (xine_t *xine, void *data) { demux_mve_class_t *this; - this = xine_xmalloc (sizeof (demux_mve_class_t)); + this = calloc(1, sizeof(demux_mve_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_yuv4mpeg2.c b/src/demuxers/demux_yuv4mpeg2.c index 9c5856710..ca8234d96 100644 --- a/src/demuxers/demux_yuv4mpeg2.c +++ b/src/demuxers/demux_yuv4mpeg2.c @@ -403,7 +403,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str demux_yuv4mpeg2_t *this; - this = xine_xmalloc (sizeof (demux_yuv4mpeg2_t)); + this = calloc(1, sizeof(demux_yuv4mpeg2_t)); this->stream = stream; this->input = input; @@ -477,7 +477,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_plugin (xine_t *xine, void *data) { demux_yuv4mpeg2_class_t *this; - this = xine_xmalloc (sizeof (demux_yuv4mpeg2_class_t)); + this = calloc(1, sizeof(demux_yuv4mpeg2_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c index 774329c05..f53ca78ee 100644 --- a/src/demuxers/demux_yuv_frames.c +++ b/src/demuxers/demux_yuv_frames.c @@ -203,7 +203,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, * if we reach this point, the input has been accepted. */ - this = xine_xmalloc (sizeof (demux_yuv_frames_t)); + this = calloc(1, sizeof(demux_yuv_frames_t)); this->stream = stream; this->input = input; @@ -253,7 +253,7 @@ static void class_dispose (demux_class_t *this_gen) { static void *init_class (xine_t *xine, void *data) { demux_yuv_frames_class_t *this; - this = xine_xmalloc (sizeof (demux_yuv_frames_class_t)); + this = calloc(1, sizeof(demux_yuv_frames_class_t)); this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c index 139939d8e..1fe2373b4 100644 --- a/src/dxr3/dxr3_decode_spu.c +++ b/src/dxr3/dxr3_decode_spu.c @@ -198,7 +198,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 +221,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 +374,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..496ef143e 100644 --- a/src/dxr3/dxr3_decode_video.c +++ b/src/dxr3/dxr3_decode_video.c @@ -193,7 +193,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 +220,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..482d094b9 100644 --- a/src/dxr3/video_out_dxr3.c +++ b/src/dxr3/video_out_dxr3.c @@ -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); diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c index f43f79fc3..30b9b49e1 100644 --- a/src/input/input_cdda.c +++ b/src/input/input_cdda.c @@ -370,7 +370,7 @@ static cdrom_toc * init_cdrom_toc(void) { cdrom_toc *toc; - toc = (cdrom_toc *) xine_xmalloc(sizeof (cdrom_toc)); + toc = calloc(1, sizeof (cdrom_toc)); toc->first_track = toc->last_track = toc->total_tracks = 0; toc->toc_entries = NULL; @@ -2536,7 +2536,7 @@ static char ** cdda_class_get_autoplay_list (input_class_t *this_gen, * device we are going to open; but it is possible that this function * gets called, before a plugin instance has been created; * let's create a dummy instance in such a condition */ - ip = (cdda_input_plugin_t *)xine_xmalloc(sizeof(cdda_input_plugin_t)); + ip = calloc(1, sizeof(cdda_input_plugin_t)); ip->stream = NULL; ip->fd = -1; ip->net_fd = -1; @@ -2637,7 +2637,7 @@ static input_plugin_t *cdda_class_get_instance (input_class_t *cls_gen, xine_str } else return NULL; - this = (cdda_input_plugin_t *) xine_xmalloc (sizeof (cdda_input_plugin_t)); + this = calloc(1, sizeof (cdda_input_plugin_t)); class->ip = this; this->stream = stream; @@ -2726,7 +2726,7 @@ static void *init_plugin (xine_t *xine, void *data) { cdda_input_class_t *this; config_values_t *config; - this = (cdda_input_class_t *) xine_xmalloc (sizeof (cdda_input_class_t)); + this = calloc(1, sizeof (cdda_input_class_t)); this->xine = xine; this->config = xine->config; diff --git a/src/input/input_dvb.c b/src/input/input_dvb.c index 795b843c5..0ec81026b 100644 --- a/src/input/input_dvb.c +++ b/src/input/input_dvb.c @@ -513,7 +513,7 @@ time_t dvb_mjdtime (char *buf) int i; unsigned int year, month, day, hour, min, sec; unsigned long int mjd; - struct tm *tma = xine_xmalloc(sizeof(struct tm)); + struct tm *tma = calloc(1, sizeof(struct tm)); time_t t; _x_assert(tma != NULL); @@ -577,11 +577,11 @@ static tuner_t *tuner_init(xine_t * xine, int adapter) tuner_t *this; int x; int test_video; - char *video_device=xine_xmalloc(200); + char *video_device=malloc(100); _x_assert(video_device != NULL); - this = (tuner_t *) xine_xmalloc(sizeof(tuner_t)); + this = calloc(1, sizeof(tuner_t)); _x_assert(this != NULL); @@ -922,7 +922,7 @@ static channel_t *load_channels(xine_t *xine, xine_stream_t *stream, int *num_ch continue; if (num_channels >= num_alloc) { - channel_t *new_channels = xine_xmalloc((num_alloc += 32) * sizeof (channel_t)); + channel_t *new_channels = calloc((num_alloc += 32), sizeof (channel_t)); _x_assert(new_channels != NULL); memcpy(new_channels, channels, num_channels * sizeof (channel_t)); free(channels); @@ -1229,7 +1229,7 @@ static void dvb_parse_si(dvb_input_plugin_t *this) { struct pollfd pfd; tuner_t *tuner = this->tuner; - tmpbuffer = xine_xmalloc (8192); + tmpbuffer = calloc(1, 8192); _x_assert(tmpbuffer != NULL); @@ -1437,13 +1437,10 @@ static void load_epg_data(dvb_input_plugin_t *this) already "found" in the stream. This information is used to initialize the channel's EPG structs when the EPG information for the channel is seen in the stream the first time. */ - seen_channels = xine_xmalloc(this->num_channels*sizeof(char)); + seen_channels = calloc(this->num_channels, sizeof(char)); _x_assert(seen_channels != NULL); - for (i = 0; i < this->num_channels; i++) { - seen_channels[i] = 0; - } - foo = xine_xmalloc(8192); + foo = calloc(1, 8192); _x_assert(foo != NULL); fd.fd = this->tuner->fd_pidfilter[EITFILTER]; @@ -1493,19 +1490,19 @@ static void load_epg_data(dvb_input_plugin_t *this) Allocate space for the strings. */ if (current_channel->epg[current_channel->epg_count] == NULL) { current_channel->epg[current_channel->epg_count] = - xine_xmalloc(sizeof(epg_entry_t)); + calloc(1, sizeof(epg_entry_t)); _x_assert(current_channel->epg[current_channel->epg_count] != NULL); current_channel->epg[current_channel->epg_count]->progname = - xine_xmalloc((MAX_EPG_PROGRAM_NAME_LENGTH + 1) * sizeof(char)); + malloc(MAX_EPG_PROGRAM_NAME_LENGTH + 1); _x_assert(current_channel->epg[current_channel->epg_count]->progname != NULL); current_channel->epg[current_channel->epg_count]->description = - xine_xmalloc((MAX_EPG_PROGRAM_DESCRIPTION_LENGTH + 1) * sizeof(char)); + malloc(MAX_EPG_PROGRAM_DESCRIPTION_LENGTH + 1); _x_assert(current_channel->epg[current_channel->epg_count]->description != NULL); current_channel->epg[current_channel->epg_count]->content = - xine_xmalloc((MAX_EPG_CONTENT_TYPE_LENGTH + 1) * sizeof(char)); + malloc(MAX_EPG_CONTENT_TYPE_LENGTH + 1); _x_assert(current_channel->epg[current_channel->epg_count]->content != NULL); current_channel->epg[current_channel->epg_count]->running = 0; @@ -1825,7 +1822,7 @@ static void show_program_info(int x, int y, int max_x, int max_y, int* last_y, if (epg_data == NULL || epg_data->progname == NULL) return; - buffer = xine_xmalloc(512); + buffer = calloc(1, 512); _x_assert(buffer != NULL); @@ -2207,7 +2204,7 @@ static void do_record (dvb_input_plugin_t *this) { this->stream->osd_renderer->hide (this->paused_osd, 0); this->record_paused=0; } else { - t=xine_xmalloc(sizeof(time_t)); + t=calloc(1, sizeof(time_t)); _x_assert(t != NULL); @@ -2876,7 +2873,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen) } ptr = this->mrl; ptr += 7; - channels = xine_xmalloc(sizeof(channel_t)); + channels = calloc(1, sizeof(channel_t)); _x_assert(channels != NULL); if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0) { free(channels); @@ -2896,7 +2893,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen) } ptr = this->mrl; ptr += 7; - channels = xine_xmalloc(sizeof(channel_t)); + channels = calloc(1, sizeof(channel_t)); _x_assert(channels != NULL); if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0) { free(channels); @@ -2919,7 +2916,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen) } ptr = this->mrl; ptr += 7; - channels = xine_xmalloc(sizeof(channel_t)); + channels = calloc(1, sizeof(channel_t)); _x_assert(channels != NULL); if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0) { @@ -2945,7 +2942,7 @@ static int dvb_plugin_open(input_plugin_t * this_gen) } ptr = this->mrl; ptr += 7; - channels = xine_xmalloc(sizeof(channel_t)); + channels = calloc(1, sizeof(channel_t)); _x_assert(channels != NULL); if (extract_channel_from_string(channels, ptr, tuner->feinfo.type) < 0) { @@ -3109,7 +3106,7 @@ static input_plugin_t *dvb_class_get_instance (input_class_t *class_gen, fprintf(stderr, "input_dvb: continuing in get_instance\n"); - this = (dvb_input_plugin_t *) xine_xmalloc (sizeof(dvb_input_plugin_t)); + this = calloc(1, sizeof(dvb_input_plugin_t)); _x_assert(this != NULL); @@ -3256,7 +3253,7 @@ static void *init_class (xine_t *xine, void *data) { dvb_input_class_t *this; config_values_t *config = xine->config; - this = (dvb_input_class_t *) xine_xmalloc (sizeof (dvb_input_class_t)); + this = calloc(1, sizeof (dvb_input_class_t)); _x_assert(this != NULL); this->xine = xine; diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c index 620ce98c4..441a4544b 100644 --- a/src/input/input_dvd.c +++ b/src/input/input_dvd.c @@ -1625,7 +1625,7 @@ static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_st if (strncasecmp (data, handled_mrl, strlen(handled_mrl) ) != 0) return NULL; - this = (dvd_input_plugin_t *) xine_xmalloc (sizeof (dvd_input_plugin_t)); + this = calloc(1, sizeof (dvd_input_plugin_t)); if (!this) { return NULL; } @@ -1758,7 +1758,7 @@ static void *init_class (xine_t *xine, void *data) { printf("input_dvd.c: config = %p\n", config); #endif - this = (dvd_input_class_t *) xine_xmalloc (sizeof (dvd_input_class_t)); + this = (dvd_input_class_t *) calloc(1, sizeof (dvd_input_class_t)); if (!this) return NULL; diff --git a/src/input/input_file.c b/src/input/input_file.c index 62d0d73d5..3364ef46b 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.c @@ -421,7 +421,7 @@ static input_plugin_t *file_class_get_instance (input_class_t *cls_gen, xine_str return NULL; } - this = (file_input_plugin_t *) xine_xmalloc (sizeof (file_input_plugin_t)); + this = (file_input_plugin_t *) calloc(1, sizeof (file_input_plugin_t)); this->stream = stream; this->mrl = mrl; this->fh = -1; @@ -849,7 +849,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen, if(num_files >= this->mrls_allocated_entries) { ++this->mrls_allocated_entries; this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); - this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t)); + this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t)); } else memset(this->mrls[num_files], 0, sizeof(xine_mrl_t)); @@ -867,7 +867,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen, if(num_files >= this->mrls_allocated_entries) { ++this->mrls_allocated_entries; this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); - this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t)); + this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t)); } else memset(this->mrls[num_files], 0, sizeof(xine_mrl_t)); @@ -885,7 +885,7 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen, if(num_files >= this->mrls_allocated_entries) { ++this->mrls_allocated_entries; this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); - this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t)); + this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t)); } else memset(this->mrls[num_files], 0, sizeof(xine_mrl_t)); @@ -965,7 +965,7 @@ static void *init_plugin (xine_t *xine, void *data) { file_input_class_t *this; config_values_t *config; - this = (file_input_class_t *) xine_xmalloc (sizeof (file_input_class_t)); + this = (file_input_class_t *) calloc(1, sizeof (file_input_class_t)); this->xine = xine; this->config = xine->config; @@ -979,7 +979,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->input_class.dispose = file_class_dispose; this->input_class.eject_media = NULL; - this->mrls = (xine_mrl_t **) xine_xmalloc(sizeof(xine_mrl_t*)); + this->mrls = (xine_mrl_t **) calloc(1, sizeof(xine_mrl_t*)); this->mrls_allocated_entries = 0; { diff --git a/src/input/input_http.c b/src/input/input_http.c index af696ca14..93198a06e 100644 --- a/src/input/input_http.c +++ b/src/input/input_http.c @@ -1022,7 +1022,7 @@ static input_plugin_t *http_class_get_instance (input_class_t *cls_gen, xine_str strncasecmp (mrl, "peercast://pls/", 15)) { return NULL; } - this = (http_input_plugin_t *) xine_xmalloc(sizeof(http_input_plugin_t)); + this = calloc(1, sizeof(http_input_plugin_t)); if (!strncasecmp (mrl, "peercast://pls/", 15)) { this->mrl = xine_xmalloc (30 + strlen(mrl) - 15); @@ -1073,7 +1073,7 @@ static void *init_class (xine_t *xine, void *data) { config_values_t *config; char *proxy_env; - this = (http_input_class_t *) xine_xmalloc (sizeof (http_input_class_t)); + this = calloc(1, sizeof (http_input_class_t)); this->xine = xine; this->config = xine->config; diff --git a/src/input/input_mms.c b/src/input/input_mms.c index 6a1e729e6..158b40448 100644 --- a/src/input/input_mms.c +++ b/src/input/input_mms.c @@ -401,7 +401,7 @@ static input_plugin_t *mms_class_get_instance (input_class_t *cls_gen, xine_stre return NULL; } - this = (mms_input_plugin_t *) xine_xmalloc (sizeof (mms_input_plugin_t)); + this = calloc(1, sizeof (mms_input_plugin_t)); cls->ip = this; this->stream = stream; this->mms = NULL; @@ -459,7 +459,7 @@ static void *init_class (xine_t *xine, void *data) { mms_input_class_t *this; - this = (mms_input_class_t *) xine_xmalloc (sizeof (mms_input_class_t)); + this = calloc(1, sizeof (mms_input_class_t)); this->xine = xine; this->ip = NULL; diff --git a/src/input/input_net.c b/src/input/input_net.c index fe78c93f4..391f33a60 100644 --- a/src/input/input_net.c +++ b/src/input/input_net.c @@ -480,7 +480,7 @@ static input_plugin_t *net_class_get_instance (input_class_t *cls_gen, xine_stre return NULL; } - this = xine_xmalloc(sizeof(net_input_plugin_t)); + this = calloc(1, sizeof(net_input_plugin_t)); this->mrl = strdup(mrl); this->host_port = strdup(filename); this->stream = stream; @@ -528,7 +528,7 @@ static void *init_class (xine_t *xine, void *data) { net_input_class_t *this; - this = (net_input_class_t *) xine_xmalloc(sizeof(net_input_class_t)); + this = calloc(1, sizeof(net_input_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/input/input_pnm.c b/src/input/input_pnm.c index 680c5b1e8..937b7c89b 100644 --- a/src/input/input_pnm.c +++ b/src/input/input_pnm.c @@ -231,7 +231,7 @@ static input_plugin_t *pnm_class_get_instance (input_class_t *cls_gen, xine_stre return NULL; } - this = (pnm_input_plugin_t *) xine_xmalloc (sizeof (pnm_input_plugin_t)); + this = calloc(1, sizeof (pnm_input_plugin_t)); this->stream = stream; this->pnm = NULL; @@ -276,7 +276,7 @@ static void *init_class (xine_t *xine, void *data) { pnm_input_class_t *this; - this = (pnm_input_class_t *) xine_xmalloc (sizeof (pnm_input_class_t)); + this = calloc(1, sizeof (pnm_input_class_t)); this->xine = xine; diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c index 1b8000072..e5c70c64d 100644 --- a/src/input/input_pvr.c +++ b/src/input/input_pvr.c @@ -379,7 +379,7 @@ static void pvrscr_exit (scr_plugin_t *scr) { static pvrscr_t* pvrscr_init (void) { pvrscr_t *this; - this = (pvrscr_t *) xine_xmalloc(sizeof(pvrscr_t)); + this = calloc(1, sizeof(pvrscr_t)); this->scr.interface_version = 3; this->scr.get_priority = pvrscr_get_priority; @@ -1480,7 +1480,7 @@ static input_plugin_t *pvr_class_get_instance (input_class_t *cls_gen, xine_stre mrl = strdup(data); aux = &mrl[5]; - this = (pvr_input_plugin_t *) xine_xmalloc (sizeof (pvr_input_plugin_t)); + this = calloc(1, sizeof (pvr_input_plugin_t)); this->class = cls; this->stream = stream; this->dev_fd = -1; @@ -1564,7 +1564,7 @@ static void *init_plugin (xine_t *xine, void *data) { pvr_input_class_t *this; - this = (pvr_input_class_t *) xine_xmalloc (sizeof (pvr_input_class_t)); + this = calloc(1, sizeof (pvr_input_class_t)); this->xine = xine; this->config = xine->config; diff --git a/src/input/input_rtp.c b/src/input/input_rtp.c index 25498f289..66fcba87e 100644 --- a/src/input/input_rtp.c +++ b/src/input/input_rtp.c @@ -717,7 +717,7 @@ static input_plugin_t *rtp_class_get_instance (input_class_t *cls_gen, } } - this = (rtp_input_plugin_t *) xine_xmalloc(sizeof(rtp_input_plugin_t)); + this = calloc(1, sizeof(rtp_input_plugin_t)); this->stream = stream; this->mrl = mrl; this->filename = filename; @@ -784,7 +784,7 @@ static void *init_class (xine_t *xine, void *data) { rtp_input_class_t *this; - this = (rtp_input_class_t *) xine_xmalloc(sizeof(rtp_input_class_t)); + this = calloc(1, sizeof(rtp_input_class_t)); this->config = xine->config; this->xine = xine; diff --git a/src/input/input_rtsp.c b/src/input/input_rtsp.c index 2895edf5d..8491d0a5d 100644 --- a/src/input/input_rtsp.c +++ b/src/input/input_rtsp.c @@ -246,7 +246,7 @@ static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, xine_str if (strncasecmp (mrl, "rtsp://", 6)) return NULL; - this = (rtsp_input_plugin_t *) xine_xmalloc (sizeof (rtsp_input_plugin_t)); + this = calloc(1, sizeof (rtsp_input_plugin_t)); this->stream = stream; this->rtsp = NULL; @@ -254,7 +254,7 @@ static input_plugin_t *rtsp_class_get_instance (input_class_t *cls_gen, xine_str /* since we handle only real streams yet, we can savely add * an .rm extention to force handling by demux_real. */ - this->public_mrl = xine_xmalloc (sizeof (char)*(strlen(this->mrl)+10)); + this->public_mrl = calloc(strlen(this->mrl)+10, sizeof (char)); sprintf(this->public_mrl, "%s.rm", this->mrl); this->nbc = nbc_init (stream); @@ -298,7 +298,7 @@ static void *init_class (xine_t *xine, void *data) { rtsp_input_class_t *this; - this = (rtsp_input_class_t *) xine_xmalloc (sizeof (rtsp_input_class_t)); + this = calloc(1, sizeof (rtsp_input_class_t)); this->xine = xine; diff --git a/src/input/input_smb.c b/src/input/input_smb.c index 777b80b46..c4706d9f3 100644 --- a/src/input/input_smb.c +++ b/src/input/input_smb.c @@ -359,7 +359,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, ++this->mrls_allocated_entries; this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); - this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t)); + this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t)); }else memset(this->mrls[num_files], 0, sizeof(xine_mrl_t)); @@ -376,7 +376,7 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen, ++this->mrls_allocated_entries; this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); - this->mrls[num_files] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t)); + this->mrls[num_files] = calloc(1, sizeof(xine_mrl_t)); }else memset(this->mrls[num_files], 0, sizeof(xine_mrl_t)); @@ -475,7 +475,7 @@ smb_class_get_instance (input_class_t *class_gen, xine_stream_t *stream, if (strncmp (mrl, "smb://",6)) return NULL; - this = (smb_input_t *)xine_xmalloc(sizeof(smb_input_t)); + this = calloc(1, sizeof(smb_input_t)); this->stream = stream; this->mrl = strdup (mrl); this->fd = -1; @@ -514,7 +514,7 @@ static void if (smbc_init(smb_auth,(xine->verbosity >= XINE_VERBOSITY_DEBUG))) goto _exit_error; - this = (smb_input_class_t *) xine_xmalloc(sizeof(smb_input_class_t)); + this = calloc(1, sizeof(smb_input_class_t)); this->xine = xine; this->input_class.get_instance = smb_class_get_instance; diff --git a/src/input/input_stdin_fifo.c b/src/input/input_stdin_fifo.c index 465e9c00b..0ae841b4b 100644 --- a/src/input/input_stdin_fifo.c +++ b/src/input/input_stdin_fifo.c @@ -311,7 +311,7 @@ static input_plugin_t *stdin_class_get_instance (input_class_t *class_gen, * => create plugin instance */ - this = (stdin_input_plugin_t *) xine_xmalloc(sizeof(stdin_input_plugin_t)); + this = calloc(1, sizeof(stdin_input_plugin_t)); this->stream = stream; this->curpos = 0; @@ -362,7 +362,7 @@ static void *init_class (xine_t *xine, void *data) { stdin_input_class_t *this; - this = (stdin_input_class_t *) xine_xmalloc (sizeof (stdin_input_class_t)); + this = calloc(1, sizeof (stdin_input_class_t)); this->xine = xine; diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c index d0558b492..7bb5322b5 100644 --- a/src/input/input_v4l.c +++ b/src/input/input_v4l.c @@ -349,7 +349,7 @@ static pvrscr_t* pvrscr_init (void) { pvrscr_t *this; - this = (pvrscr_t *) xine_xmalloc(sizeof(pvrscr_t)); + this = calloc(1, sizeof(pvrscr_t)); this->scr.interface_version = 3; this->scr.get_priority = pvrscr_get_priority; @@ -719,13 +719,13 @@ static void allocate_audio_frames(v4l_input_plugin_t *this) buf_element_t *frame; /* Audio frame */ - frame = xine_xmalloc(sizeof(buf_element_t)); + frame = calloc(1, sizeof(buf_element_t)); frame->content = xine_xmalloc(this->periodsize); frame->type = BUF_AUDIO_LPCM_LE; frame->source = this; frame->free_buffer = store_aud_frame; - frame->extra_info = xine_xmalloc(sizeof(extra_info_t)); + frame->extra_info = calloc(1, sizeof(extra_info_t)); store_aud_frame(frame); } @@ -957,13 +957,13 @@ static int open_video_capture_device(v4l_input_plugin_t *this) for (i = 0; i < NUM_FRAMES; i++) { buf_element_t *frame; - frame = xine_xmalloc (sizeof (buf_element_t)); + frame = calloc(1, sizeof (buf_element_t)); frame->content = xine_xmalloc (this->frame_size); frame->type = this->frame_format; frame->source = this; frame->free_buffer = store_vid_frame; - frame->extra_info = xine_xmalloc(sizeof(extra_info_t)); + frame->extra_info = calloc(1, sizeof(extra_info_t)); store_vid_frame(frame); } @@ -1715,7 +1715,7 @@ static input_plugin_t *v4l_class_get_instance (input_class_t *cls_gen, return NULL; } - this = (v4l_input_plugin_t *) xine_xmalloc (sizeof (v4l_input_plugin_t)); + this = calloc(1, sizeof (v4l_input_plugin_t)); extract_mrl(this, mrl); @@ -1900,7 +1900,7 @@ static void *init_video_class (xine_t *xine, void *data) v4l_input_class_t *this; config_values_t *config = xine->config; - this = (v4l_input_class_t *) xine_xmalloc (sizeof (v4l_input_class_t)); + this = calloc(1, sizeof (v4l_input_class_t)); this->xine = xine; @@ -1934,7 +1934,7 @@ static void *init_radio_class (xine_t *xine, void *data) v4l_input_class_t *this; config_values_t *config = xine->config; - this = (v4l_input_class_t *) xine_xmalloc (sizeof (v4l_input_class_t)); + this = calloc(1, sizeof (v4l_input_class_t)); this->xine = xine; diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c index 007fa5946..02c2e83ab 100644 --- a/src/input/input_vcd.c +++ b/src/input/input_vcd.c @@ -889,7 +889,7 @@ static input_plugin_t *vcd_class_get_instance (input_class_t *cls_gen, xine_stre return 0; } - this = (vcd_input_plugin_t *) xine_xmalloc(sizeof(vcd_input_plugin_t)); + this = calloc(1, sizeof(vcd_input_plugin_t)); this->stream = stream; this->mrl = mrl; @@ -991,7 +991,7 @@ static xine_mrl_t **vcd_class_get_dir (input_class_t *this_gen, const char *file ++this->mrls_allocated_entries; /* note: 1 extra pointer for terminating NULL */ this->mrls = realloc(this->mrls, (this->mrls_allocated_entries+1) * sizeof(xine_mrl_t*)); - this->mrls[(i-1)] = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t)); + this->mrls[(i-1)] = calloc(1, sizeof(xine_mrl_t)); } else { memset(this->mrls[(i-1)], 0, sizeof(xine_mrl_t)); @@ -1079,7 +1079,7 @@ static void *init_class (xine_t *xine, void *data) { config_values_t *config = xine->config; int i; - this = (vcd_input_class_t *) xine_xmalloc (sizeof (vcd_input_class_t)); + this = calloc(1, sizeof (vcd_input_class_t)); this->xine = xine; @@ -1097,11 +1097,11 @@ static void *init_class (xine_t *xine, void *data) { "you intend to play your VideoCDs with."), 10, device_change_cb, (void *)this); - this->mrls = (xine_mrl_t **) xine_xmalloc(sizeof(xine_mrl_t*)); + this->mrls = calloc(1, sizeof(xine_mrl_t*)); this->mrls_allocated_entries = 0; for (i = 0; i < 100; i++) { - this->filelist[i] = (char *) xine_xmalloc(sizeof(char *) * 256); + this->filelist[i] = calloc(256, sizeof(char)); } return this; diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c index fecf9a794..dc3f00105 100644 --- a/src/input/libreal/real.c +++ b/src/input/libreal/real.c @@ -449,7 +449,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt if (!desc) return NULL; buf=xine_buffer_init(2048); - header = xine_xmalloc(sizeof(rmff_header_t)); + header = calloc(1, sizeof(rmff_header_t)); header->fileheader=rmff_new_fileheader(4+desc->stream_count); header->cont=rmff_new_cont( diff --git a/src/input/libreal/sdpplin.c b/src/input/libreal/sdpplin.c index 9117d15a5..2596391f9 100644 --- a/src/input/libreal/sdpplin.c +++ b/src/input/libreal/sdpplin.c @@ -122,7 +122,7 @@ static int filter(const char *in, const char *filter, char **out) { } static sdpplin_stream_t *sdpplin_parse_stream(char **data) { - sdpplin_stream_t *desc = xine_xmalloc(sizeof(sdpplin_stream_t)); + sdpplin_stream_t *desc = calloc(1, sizeof(sdpplin_stream_t)); char *buf=xine_buffer_init(32); char *decoded=xine_buffer_init(32); int handled; @@ -239,7 +239,7 @@ static sdpplin_stream_t *sdpplin_parse_stream(char **data) { sdpplin_t *sdpplin_parse(char *data) { - sdpplin_t *desc = xine_xmalloc(sizeof(sdpplin_t)); + sdpplin_t *desc = calloc(1, sizeof(sdpplin_t)); sdpplin_stream_t *stream; char *buf=xine_buffer_init(32); char *decoded=xine_buffer_init(32); diff --git a/src/input/librtsp/rtsp_session.c b/src/input/librtsp/rtsp_session.c index 5b02282e9..4e636410d 100644 --- a/src/input/librtsp/rtsp_session.c +++ b/src/input/librtsp/rtsp_session.c @@ -78,7 +78,7 @@ const char *rtsp_bandwidth_strs[]={"14.4 Kbps (Modem)", "19.2 Kbps (Modem)", rtsp_session_t *rtsp_session_start(xine_stream_t *stream, char *mrl) { - rtsp_session_t *rtsp_session = xine_xmalloc(sizeof(rtsp_session_t)); + rtsp_session_t *rtsp_session = calloc(1, sizeof(rtsp_session_t)); xine_t *xine = stream->xine; char *server; char *mrl_line=strdup(mrl); diff --git a/src/input/mms.c b/src/input/mms.c index 4a073f0ae..97a05dd89 100644 --- a/src/input/mms.c +++ b/src/input/mms.c @@ -680,7 +680,7 @@ mms_t *mms_connect (xine_stream_t *stream, const char *url, int bandwidth) { if (!url) return NULL; - this = (mms_t*) xine_xmalloc (sizeof (mms_t)); + this = calloc(1, sizeof (mms_t)); this->stream = stream; this->url = strdup (url); diff --git a/src/input/mmsh.c b/src/input/mmsh.c index ae1c62bc1..2feb7c37b 100644 --- a/src/input/mmsh.c +++ b/src/input/mmsh.c @@ -636,7 +636,7 @@ mmsh_t *mmsh_connect (xine_stream_t *stream, const char *url, int bandwidth) { report_progress (stream, 0); - this = (mmsh_t*) xine_xmalloc (sizeof (mmsh_t)); + this = calloc(1, sizeof (mmsh_t)); this->stream = stream; this->url = strdup(url); diff --git a/src/input/net_buf_ctrl.c b/src/input/net_buf_ctrl.c index 1a8ae388e..4a39aadfb 100644 --- a/src/input/net_buf_ctrl.c +++ b/src/input/net_buf_ctrl.c @@ -492,7 +492,7 @@ static void nbc_get_cb (fifo_buffer_t *fifo, nbc_t *nbc_init (xine_stream_t *stream) { - nbc_t *this = (nbc_t *) xine_xmalloc (sizeof (nbc_t)); + nbc_t *this = calloc(1, sizeof (nbc_t)); fifo_buffer_t *video_fifo = stream->video_fifo; fifo_buffer_t *audio_fifo = stream->audio_fifo; double video_fifo_factor, audio_fifo_factor; diff --git a/src/input/pnm.c b/src/input/pnm.c index 3516ab262..edd7a5d71 100644 --- a/src/input/pnm.c +++ b/src/input/pnm.c @@ -716,7 +716,7 @@ pnm_t *pnm_connect(xine_stream_t *stream, const char *mrl) { mrl_ptr+=6; - p = xine_xmalloc(sizeof(pnm_t)); + p = calloc(1, sizeof(pnm_t)); p->stream = stream; p->port=7070; p->url=strdup(mrl); diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c index 2e52ccc0f..d024c5bff 100644 --- a/src/input/vcd/xineplug_inp_vcd.c +++ b/src/input/vcd/xineplug_inp_vcd.c @@ -1767,7 +1767,7 @@ vcd_init (xine_t *xine, void *data) dbg_print(INPUT_DBG_CALL, "Called\n"); - class = (vcd_input_class_t *) xine_xmalloc (sizeof (vcd_input_class_t)); + class = calloc(1, sizeof (vcd_input_class_t)); class->xine = xine; class->config = config = xine->config; diff --git a/src/liba52/parse.c b/src/liba52/parse.c index 0bfd02fce..f1adc2f40 100644 --- a/src/liba52/parse.c +++ b/src/liba52/parse.c @@ -49,7 +49,7 @@ a52_state_t * a52_init (uint32_t mm_accel) a52_state_t * state; int i; - state = xine_xmalloc (sizeof (a52_state_t)); + state = calloc(1, sizeof (a52_state_t)); if (state == NULL) return NULL; diff --git a/src/liba52/xine_a52_decoder.c b/src/liba52/xine_a52_decoder.c index b8b500ecd..0f9ed3ad5 100644 --- a/src/liba52/xine_a52_decoder.c +++ b/src/liba52/xine_a52_decoder.c @@ -654,7 +654,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre lprintf ("open_plugin called\n"); - this = (a52dec_decoder_t *) xine_xmalloc (sizeof (a52dec_decoder_t)); + this = calloc(1, sizeof (a52dec_decoder_t)); this->audio_decoder.decode_data = a52dec_decode_data; this->audio_decoder.reset = a52dec_reset; @@ -806,7 +806,7 @@ static void *init_plugin (xine_t *xine, void *data) { a52dec_class_t *this; config_values_t *cfg; - this = (a52dec_class_t *) xine_xmalloc (sizeof (a52dec_class_t)); + this = calloc(1, sizeof (a52dec_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libdts/xine_dts_decoder.c b/src/libdts/xine_dts_decoder.c index 2b5bedb83..669ae85da 100644 --- a/src/libdts/xine_dts_decoder.c +++ b/src/libdts/xine_dts_decoder.c @@ -489,7 +489,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre lprintf("open_plugin\n"); - this = (dts_decoder_t *) xine_xmalloc (sizeof (dts_decoder_t)); + this = calloc(1, sizeof (dts_decoder_t)); this->audio_decoder.decode_data = dts_decode_data; this->audio_decoder.reset = dts_reset; @@ -598,7 +598,7 @@ static void *init_plugin (xine_t *xine, void *data) { lprintf("init_plugin\n"); - this = (dts_class_t *) xine_xmalloc (sizeof (dts_class_t)); + this = calloc(1, sizeof (dts_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libfaad/xine_faad_decoder.c b/src/libfaad/xine_faad_decoder.c index 934140a32..6f86d95fd 100644 --- a/src/libfaad/xine_faad_decoder.c +++ b/src/libfaad/xine_faad_decoder.c @@ -320,7 +320,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if( !this->faac_dec && (buf->decoder_flags & BUF_FLAG_SPECIAL) && buf->decoder_info[1] == BUF_SPECIAL_DECODER_CONFIG ) { - this->dec_config = xine_xmalloc(buf->decoder_info[2]); + this->dec_config = malloc(buf->decoder_info[2]); this->dec_config_size = buf->decoder_info[2]; memcpy(this->dec_config, buf->decoder_info_ptr[2], buf->decoder_info[2]); @@ -341,7 +341,7 @@ static void faad_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { xine_waveformatex *wavex = (xine_waveformatex *) buf->content; if( wavex->cbSize > 0 ) { - this->dec_config = xine_xmalloc(wavex->cbSize); + this->dec_config = malloc(wavex->cbSize); this->dec_config_size = wavex->cbSize; memcpy(this->dec_config, buf->content + sizeof(xine_waveformatex), wavex->cbSize); @@ -417,7 +417,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre faad_decoder_t *this ; - this = (faad_decoder_t *) xine_xmalloc (sizeof (faad_decoder_t)); + this = calloc(1, sizeof (faad_decoder_t)); this->audio_decoder.decode_data = faad_decode_data; this->audio_decoder.reset = faad_reset; @@ -458,7 +458,7 @@ static void *init_plugin (xine_t *xine, void *data) { faad_class_t *this ; - this = (faad_class_t *) xine_xmalloc (sizeof (faad_class_t)); + this = calloc(1, sizeof (faad_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libmad/xine_mad_decoder.c b/src/libmad/xine_mad_decoder.c index 021814ca9..31b313818 100644 --- a/src/libmad/xine_mad_decoder.c +++ b/src/libmad/xine_mad_decoder.c @@ -346,7 +346,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre mad_decoder_t *this ; - this = (mad_decoder_t *) xine_xmalloc (sizeof (mad_decoder_t)); + this = (mad_decoder_t *) calloc(1, sizeof(mad_decoder_t)); this->audio_decoder.decode_data = mad_decode_data; this->audio_decoder.reset = mad_reset; @@ -390,7 +390,7 @@ static void *init_plugin (xine_t *xine, void *data) { mad_class_t *this; - this = (mad_class_t *) xine_xmalloc (sizeof (mad_class_t)); + this = (mad_class_t *) calloc(1, sizeof(mad_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libmpeg2/xine_mpeg2_decoder.c b/src/libmpeg2/xine_mpeg2_decoder.c index 4c4cc8654..123374a08 100644 --- a/src/libmpeg2/xine_mpeg2_decoder.c +++ b/src/libmpeg2/xine_mpeg2_decoder.c @@ -117,7 +117,7 @@ static void mpeg2dec_dispose (video_decoder_t *this_gen) { static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) { mpeg2dec_decoder_t *this ; - this = (mpeg2dec_decoder_t *) xine_xmalloc (sizeof (mpeg2dec_decoder_t)); + this = (mpeg2dec_decoder_t *) calloc(1, sizeof(mpeg2dec_decoder_t)); this->video_decoder.decode_data = mpeg2dec_decode_data; this->video_decoder.flush = mpeg2dec_flush; @@ -155,7 +155,7 @@ static void *init_plugin (xine_t *xine, void *data) { mpeg2_class_t *this; - this = (mpeg2_class_t *) xine_xmalloc (sizeof (mpeg2_class_t)); + this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libmpeg2new/xine_mpeg2new_decoder.c b/src/libmpeg2new/xine_mpeg2new_decoder.c index 7ceac9178..c096ccfa7 100644 --- a/src/libmpeg2new/xine_mpeg2new_decoder.c +++ b/src/libmpeg2new/xine_mpeg2new_decoder.c @@ -449,7 +449,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre mpeg2_video_decoder_t *this ; int32_t n; - this = (mpeg2_video_decoder_t *) xine_xmalloc (sizeof (mpeg2_video_decoder_t)); + this = (mpeg2_video_decoder_t *) calloc(1, sizeof(mpeg2_video_decoder_t)); this->video_decoder.decode_data = mpeg2_video_decode_data; this->video_decoder.flush = mpeg2_video_flush; @@ -490,7 +490,7 @@ static void *init_plugin (xine_t *xine, void *data) { mpeg2_class_t *this; - this = (mpeg2_class_t *) xine_xmalloc (sizeof (mpeg2_class_t)); + this = (mpeg2_class_t *) calloc(1, sizeof(mpeg2_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libmusepack/xine_musepack_decoder.c b/src/libmusepack/xine_musepack_decoder.c index 7a2d30a06..39d17f574 100644 --- a/src/libmusepack/xine_musepack_decoder.c +++ b/src/libmusepack/xine_musepack_decoder.c @@ -396,7 +396,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre mpc_decoder_t *this ; - this = (mpc_decoder_t *) xine_xmalloc (sizeof (mpc_decoder_t)); + this = (mpc_decoder_t *) calloc(1, sizeof(mpc_decoder_t)); /* connect the member functions */ this->audio_decoder.decode_data = mpc_decode_data; @@ -441,7 +441,7 @@ static void *init_plugin (xine_t *xine, void *data) { mpc_class_t *this ; - this = (mpc_class_t *) xine_xmalloc (sizeof (mpc_class_t)); + this = (mpc_class_t *) calloc(1, sizeof(mpc_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libreal/xine_real_audio_decoder.c b/src/libreal/xine_real_audio_decoder.c index ed3159a84..296077b6d 100644 --- a/src/libreal/xine_real_audio_decoder.c +++ b/src/libreal/xine_real_audio_decoder.c @@ -477,7 +477,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, real_class_t *cls = (real_class_t *) class_gen; realdec_decoder_t *this ; - this = (realdec_decoder_t *) xine_xmalloc (sizeof (realdec_decoder_t)); + this = (realdec_decoder_t *) calloc(1, sizeof(realdec_decoder_t)); this->audio_decoder.decode_data = realdec_decode_data; this->audio_decoder.reset = realdec_reset; @@ -512,7 +512,7 @@ void *init_realadec (xine_t *xine, void *data) { real_class_t *this; config_values_t *config = xine->config; - this = (real_class_t *) xine_xmalloc (sizeof (real_class_t)); + this = (real_class_t *) calloc(1, sizeof(real_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libreal/xine_real_video_decoder.c b/src/libreal/xine_real_video_decoder.c index cb7794cca..e048b04d6 100644 --- a/src/libreal/xine_real_video_decoder.c +++ b/src/libreal/xine_real_video_decoder.c @@ -278,7 +278,7 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) { this->frame_size = this->width * this->height; this->frame_buffer = xine_xmalloc (this->width * this->height * 3 / 2); - this->chunk_buffer = xine_xmalloc (BUF_SIZE); + this->chunk_buffer = calloc(1, BUF_SIZE); this->chunk_buffer_max = BUF_SIZE; return 1; @@ -496,7 +496,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, real_class_t *cls = (real_class_t *) class_gen; realdec_decoder_t *this ; - this = (realdec_decoder_t *) xine_xmalloc (sizeof (realdec_decoder_t)); + this = (realdec_decoder_t *) calloc(1, sizeof(realdec_decoder_t)); this->video_decoder.decode_data = realdec_decode_data; this->video_decoder.flush = realdec_flush; @@ -535,7 +535,7 @@ void *init_realvdec (xine_t *xine, void *data) { real_class_t *this; config_values_t *config = xine->config; - this = (real_class_t *) xine_xmalloc (sizeof (real_class_t)); + this = (real_class_t *) calloc(1, sizeof(real_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libspucc/cc_decoder.c b/src/libspucc/cc_decoder.c index 8d666e847..1452a87ad 100644 --- a/src/libspucc/cc_decoder.c +++ b/src/libspucc/cc_decoder.c @@ -922,7 +922,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 +1439,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/xine_cc_decoder.c b/src/libspucc/xine_cc_decoder.c index 9cdb4c4ea..0018bfa1e 100644 --- a/src/libspucc/xine_cc_decoder.c +++ b/src/libspucc/xine_cc_decoder.c @@ -301,7 +301,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 +338,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; diff --git a/src/libspucmml/xine_cmml_decoder.c b/src/libspucmml/xine_cmml_decoder.c index b684d21cb..90a0ca64a 100644 --- a/src/libspucmml/xine_cmml_decoder.c +++ b/src/libspucmml/xine_cmml_decoder.c @@ -450,7 +450,7 @@ static spu_decoder_t *spucmml_class_open_plugin (spu_decoder_class_t *class_gen, spucmml_class_t *class = (spucmml_class_t *)class_gen; spucmml_decoder_t *this ; - this = (spucmml_decoder_t *) xine_xmalloc (sizeof (spucmml_decoder_t)); + this = (spucmml_decoder_t *) calloc(1, sizeof(spucmml_decoder_t)); this->spu_decoder.decode_data = spudec_decode_data; this->spu_decoder.reset = spudec_reset; @@ -514,7 +514,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { spucmml_class_t *this ; - this = (spucmml_class_t *) xine_xmalloc (sizeof (spucmml_class_t)); + this = (spucmml_class_t *) calloc(1, sizeof(spucmml_class_t)); this->class.open_plugin = spucmml_class_open_plugin; this->class.get_identifier = spucmml_class_get_identifier; diff --git a/src/libspudec/spu.c b/src/libspudec/spu.c index ce3497ef0..b41387dfb 100644 --- a/src/libspudec/spu.c +++ b/src/libspudec/spu.c @@ -209,7 +209,7 @@ void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf) { #endif /* 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 = malloc(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/libspudec/xine_spu_decoder.c b/src/libspudec/xine_spu_decoder.c index 0ab91d906..c604686e9 100644 --- a/src/libspudec/xine_spu_decoder.c +++ b/src/libspudec/xine_spu_decoder.c @@ -227,9 +227,9 @@ static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t video_overlay_manager_t *ovl_manager; video_overlay_event_t *overlay_event = NULL; vo_overlay_t *overlay = NULL; - overlay_event = xine_xmalloc (sizeof(video_overlay_event_t)); + overlay_event = calloc(1, sizeof(video_overlay_event_t)); - overlay = xine_xmalloc (sizeof(vo_overlay_t)); + overlay = calloc(1, sizeof(vo_overlay_t)); /* FIXME: Watch out for threads. We should really put a lock on this * because events is a different thread than decode_data */ @@ -315,7 +315,7 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t spudec_decoder_t *this ; int i; - this = (spudec_decoder_t *) xine_xmalloc (sizeof (spudec_decoder_t)); + this = (spudec_decoder_t *) calloc(1, sizeof (spudec_decoder_t)); this->spu_decoder.decode_data = spudec_decode_data; this->spu_decoder.reset = spudec_reset; @@ -328,7 +328,7 @@ static spu_decoder_t *open_plugin (spu_decoder_class_t *class_gen, xine_stream_t this->menu_handle = -1; this->buttonN = 1; - this->event.object.overlay = xine_xmalloc(sizeof(vo_overlay_t)); + this->event.object.overlay = calloc(1, sizeof(vo_overlay_t)); pthread_mutex_init(&this->nav_pci_lock, NULL); this->pci_cur.pci.hli.hl_gi.hli_ss = 0; @@ -376,7 +376,7 @@ static void *init_plugin (xine_t *xine, void *data) { spudec_class_t *this; - this = (spudec_class_t *) xine_xmalloc (sizeof (spudec_class_t)); + this = calloc(1, sizeof (spudec_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libspudvb/xine_spudvb_decoder.c b/src/libspudvb/xine_spudvb_decoder.c index 602723fcb..40d2a205a 100644 --- a/src/libspudvb/xine_spudvb_decoder.c +++ b/src/libspudvb/xine_spudvb_decoder.c @@ -907,7 +907,7 @@ static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen dvb_spu_decoder_t *this; dvb_spu_class_t *class = (dvb_spu_class_t *) class_gen; - this = (dvb_spu_decoder_t *) xine_xmalloc (sizeof (dvb_spu_decoder_t)); + this = calloc(1, sizeof (dvb_spu_decoder_t)); this->spu_decoder.decode_data = spudec_decode_data; this->spu_decoder.reset = spudec_reset; @@ -919,10 +919,10 @@ static spu_decoder_t *dvb_spu_class_open_plugin (spu_decoder_class_t * class_gen this->class = class; this->stream = stream; - this->pes_pkt = xine_xmalloc (1024*65); - this->spu_descriptor = xine_xmalloc(sizeof(spu_dvb_descriptor_t)); + this->pes_pkt = calloc(65, 1024); + this->spu_descriptor = calloc(1, sizeof(spu_dvb_descriptor_t)); - this->dvbsub = xine_xmalloc (sizeof (dvbsub_func_t)); + this->dvbsub = calloc(1, sizeof (dvbsub_func_t)); for (i = 0; i < MAX_REGIONS; i++) { this->dvbsub->page.regions[i].is_visible = 0; @@ -959,7 +959,7 @@ static void *init_spu_decoder_plugin (xine_t * xine, void *data) { dvb_spu_class_t *this; - this = (dvb_spu_class_t *) xine_xmalloc (sizeof (dvb_spu_class_t)); + this = calloc(1, sizeof (dvb_spu_class_t)); this->class.open_plugin = dvb_spu_class_open_plugin; this->class.get_identifier = dvb_spu_class_get_identifier; diff --git a/src/libsputext/demux_sputext.c b/src/libsputext/demux_sputext.c index c80e2b496..b159d3d7f 100644 --- a/src/libsputext/demux_sputext.c +++ b/src/libsputext/demux_sputext.c @@ -1165,7 +1165,7 @@ static subtitle_t *sub_read_file (demux_sputext_t *this) { this->buflen = 0; this->num=0;n_max=32; - first = (subtitle_t *) xine_xmalloc(n_max*sizeof(subtitle_t)); + first = calloc(n_max, sizeof(subtitle_t)); if(!first) return NULL; timeout = ((demux_sputext_class_t *) (this->demux_plugin.demux_class))->max_timeout; @@ -1363,7 +1363,7 @@ static demux_plugin_t *open_demux_plugin (demux_class_t *class_gen, xine_stream_ lprintf("open_plugin() called\n"); - this = xine_xmalloc (sizeof (demux_sputext_t)); + this = calloc(1, sizeof (demux_sputext_t)); this->stream = stream; this->input = input; @@ -1465,7 +1465,7 @@ static void *init_sputext_demux_class (xine_t *xine, void *data) { lprintf("initializing\n"); - this = xine_xmalloc (sizeof (demux_sputext_class_t)); + this = calloc(1, sizeof (demux_sputext_class_t)); this->demux_class.open_plugin = open_demux_plugin; this->demux_class.get_description = get_demux_description; diff --git a/src/libsputext/xine_sputext_decoder.c b/src/libsputext/xine_sputext_decoder.c index d0cab9cbf..9d5a7cc29 100644 --- a/src/libsputext/xine_sputext_decoder.c +++ b/src/libsputext/xine_sputext_decoder.c @@ -1081,7 +1081,7 @@ static spu_decoder_t *sputext_class_open_plugin (spu_decoder_class_t *class_gen, sputext_class_t *class = (sputext_class_t *)class_gen; sputext_decoder_t *this ; - this = (sputext_decoder_t *) xine_xmalloc (sizeof (sputext_decoder_t)); + this = (sputext_decoder_t *) calloc(1, sizeof(sputext_decoder_t)); this->spu_decoder.decode_data = spudec_decode_data; this->spu_decoder.reset = spudec_reset; @@ -1135,7 +1135,7 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) { lprintf("init class\n"); - this = (sputext_class_t *) xine_xmalloc (sizeof (sputext_class_t)); + this = (sputext_class_t *) calloc(1, sizeof(sputext_class_t)); this->class.open_plugin = sputext_class_open_plugin; this->class.get_identifier = sputext_class_get_identifier; diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c index 3053b2b68..99e2ba9d4 100644 --- a/src/libw32dll/qt_decoder.c +++ b/src/libw32dll/qt_decoder.c @@ -553,7 +553,7 @@ static audio_decoder_t *qta_open_plugin (audio_decoder_class_t *class_gen, qta_decoder_t *this ; - this = (qta_decoder_t *) xine_xmalloc (sizeof (qta_decoder_t)); + this = (qta_decoder_t *) calloc(1, sizeof(qta_decoder_t)); this->audio_decoder.decode_data = qta_decode_data; this->audio_decoder.reset = qta_reset; @@ -592,7 +592,7 @@ static void *qta_init_class (xine_t *xine, void *data) { pthread_once (&once_control, init_routine); - this = (qta_class_t *) xine_xmalloc (sizeof (qta_class_t)); + this = (qta_class_t *) calloc(1, sizeof(qta_class_t)); this->decoder_class.open_plugin = qta_open_plugin; this->decoder_class.get_identifier = qta_get_identifier; @@ -1063,7 +1063,7 @@ static video_decoder_t *qtv_open_plugin (video_decoder_class_t *class_gen, qtv_class_t *cls = (qtv_class_t *) class_gen; qtv_decoder_t *this ; - this = (qtv_decoder_t *) xine_xmalloc (sizeof (qtv_decoder_t)); + this = (qtv_decoder_t *) calloc(1, sizeof(qtv_decoder_t)); this->video_decoder.decode_data = qtv_decode_data; this->video_decoder.flush = qtv_flush; @@ -1116,7 +1116,7 @@ static void *qtv_init_class (xine_t *xine, void *data) { pthread_once (&once_control, init_routine); - this = (qtv_class_t *) xine_xmalloc (sizeof (qtv_class_t)); + this = (qtv_class_t *) calloc(1, sizeof(qtv_class_t)); this->decoder_class.open_plugin = qtv_open_plugin; this->decoder_class.get_identifier = qtv_get_identifier; diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c index 88790ebc7..64d29aeac 100644 --- a/src/libw32dll/w32codec.c +++ b/src/libw32dll/w32codec.c @@ -1550,7 +1550,7 @@ static video_decoder_t *open_video_decoder_plugin (video_decoder_class_t *class_ w32v_decoder_t *this ; - this = (w32v_decoder_t *) xine_xmalloc (sizeof (w32v_decoder_t)); + this = (w32v_decoder_t *) calloc(1, sizeof(w32v_decoder_t)); this->video_decoder.decode_data = w32v_decode_data; this->video_decoder.flush = w32v_flush; @@ -1593,7 +1593,7 @@ static void *init_video_decoder_class (xine_t *xine, void *data) { cfg = xine->config; if ((win32_def_path = get_win32_codecs_path(cfg)) == NULL) return NULL; - this = (w32v_class_t *) xine_xmalloc (sizeof (w32v_class_t)); + this = (w32v_class_t *) calloc(1, sizeof(w32v_class_t)); this->decoder_class.open_plugin = open_video_decoder_plugin; this->decoder_class.get_identifier = get_video_identifier; @@ -1614,7 +1614,7 @@ static audio_decoder_t *open_audio_decoder_plugin (audio_decoder_class_t *class_ w32a_decoder_t *this ; - this = (w32a_decoder_t *) xine_xmalloc (sizeof (w32a_decoder_t)); + this = (w32a_decoder_t *) calloc(1, sizeof(w32a_decoder_t)); this->audio_decoder.decode_data = w32a_decode_data; this->audio_decoder.reset = w32a_reset; @@ -1655,7 +1655,7 @@ static void *init_audio_decoder_class (xine_t *xine, void *data) { cfg = xine->config; if ((win32_def_path = get_win32_codecs_path(cfg)) == NULL) return NULL; - this = (w32a_class_t *) xine_xmalloc (sizeof (w32a_class_t)); + this = (w32a_class_t *) calloc(1, sizeof(w32a_class_t)); this->decoder_class.open_plugin = open_audio_decoder_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c index 5ab4fa1f6..319eefb0e 100644 --- a/src/libxineadec/fooaudio.c +++ b/src/libxineadec/fooaudio.c @@ -91,7 +91,7 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) this->channels = buf->decoder_info[3]; /* initialize the data accumulation buffer */ - this->buf = xine_xmalloc(AUDIOBUFSIZE); + this->buf = calloc(1, AUDIOBUFSIZE); this->bufsize = AUDIOBUFSIZE; this->size = 0; @@ -255,7 +255,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre fooaudio_decoder_t *this ; - this = (fooaudio_decoder_t *) xine_xmalloc (sizeof (fooaudio_decoder_t)); + this = (fooaudio_decoder_t *) calloc(1, sizeof(fooaudio_decoder_t)); /* connect the member functions */ this->audio_decoder.decode_data = fooaudio_decode_data; diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c index 23c0d2104..c67382bc5 100644 --- a/src/libxineadec/gsm610.c +++ b/src/libxineadec/gsm610.c @@ -101,7 +101,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { if (buf->decoder_flags & BUF_FLAG_STDHEADER) { this->sample_rate = buf->decoder_info[1]; - this->buf = xine_xmalloc(AUDIOBUFSIZE); + this->buf = calloc(1, AUDIOBUFSIZE); this->bufsize = AUDIOBUFSIZE; this->size = 0; @@ -233,7 +233,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre gsm610_decoder_t *this ; - this = (gsm610_decoder_t *) xine_xmalloc (sizeof (gsm610_decoder_t)); + this = (gsm610_decoder_t *) calloc(1, sizeof(gsm610_decoder_t)); this->audio_decoder.decode_data = gsm610_decode_data; this->audio_decoder.reset = gsm610_reset; @@ -265,7 +265,7 @@ static void *init_plugin (xine_t *xine, void *data) { gsm610_class_t *this ; - this = (gsm610_class_t *) xine_xmalloc (sizeof (gsm610_class_t)); + this = (gsm610_class_t *) calloc(1, sizeof(gsm610_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libxineadec/nsf.c b/src/libxineadec/nsf.c index bdf523f1d..4b476d036 100644 --- a/src/libxineadec/nsf.c +++ b/src/libxineadec/nsf.c @@ -205,7 +205,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre nsf_decoder_t *this ; - this = (nsf_decoder_t *) xine_xmalloc (sizeof (nsf_decoder_t)); + this = (nsf_decoder_t *) calloc(1, sizeof(nsf_decoder_t)); /* connect the member functions */ this->audio_decoder.decode_data = nsf_decode_data; @@ -255,7 +255,7 @@ static void *init_plugin (xine_t *xine, void *data) { nsf_class_t *this ; - this = (nsf_class_t *) xine_xmalloc (sizeof (nsf_class_t)); + this = (nsf_class_t *) calloc(1, sizeof(nsf_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libxineadec/xine_lpcm_decoder.c b/src/libxineadec/xine_lpcm_decoder.c index eeed7ba35..e1d81a8bb 100644 --- a/src/libxineadec/xine_lpcm_decoder.c +++ b/src/libxineadec/xine_lpcm_decoder.c @@ -240,7 +240,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre lpcm_decoder_t *this ; - this = (lpcm_decoder_t *) xine_xmalloc (sizeof (lpcm_decoder_t)); + this = (lpcm_decoder_t *) calloc(1, sizeof(lpcm_decoder_t)); this->audio_decoder.decode_data = lpcm_decode_data; this->audio_decoder.reset = lpcm_reset; @@ -275,7 +275,7 @@ static void *init_plugin (xine_t *xine, void *data) { lpcm_class_t *this ; - this = (lpcm_class_t *) xine_xmalloc (sizeof (lpcm_class_t)); + this = (lpcm_class_t *) calloc(1, sizeof(lpcm_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libxineadec/xine_speex_decoder.c b/src/libxineadec/xine_speex_decoder.c index dd7f988e2..1ae310d80 100644 --- a/src/libxineadec/xine_speex_decoder.c +++ b/src/libxineadec/xine_speex_decoder.c @@ -355,7 +355,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, speex_decoder_t *this ; static SpeexStereoState init_stereo = SPEEX_STEREO_STATE_INIT; - this = (speex_decoder_t *) xine_xmalloc (sizeof (speex_decoder_t)); + this = (speex_decoder_t *) calloc(1, sizeof(speex_decoder_t)); this->audio_decoder.decode_data = speex_decode_data; this->audio_decoder.reset = speex_reset; @@ -396,7 +396,7 @@ static void *init_plugin (xine_t *xine, void *data) { speex_class_t *this; - this = (speex_class_t *) xine_xmalloc (sizeof (speex_class_t)); + this = (speex_class_t *) calloc(1, sizeof(speex_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libxineadec/xine_vorbis_decoder.c b/src/libxineadec/xine_vorbis_decoder.c index b3acff811..218c26033 100644 --- a/src/libxineadec/xine_vorbis_decoder.c +++ b/src/libxineadec/xine_vorbis_decoder.c @@ -315,7 +315,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, vorbis_decoder_t *this ; - this = (vorbis_decoder_t *) xine_xmalloc (sizeof (vorbis_decoder_t)); + this = (vorbis_decoder_t *) calloc(1, sizeof(vorbis_decoder_t)); this->audio_decoder.decode_data = vorbis_decode_data; this->audio_decoder.reset = vorbis_reset; @@ -328,7 +328,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, this->convsize = 0; this->bufsize = INIT_BUFSIZE; - this->buf = xine_xmalloc(INIT_BUFSIZE); + this->buf = calloc(1, INIT_BUFSIZE); this->size = 0; vorbis_info_init(&this->vi); @@ -359,7 +359,7 @@ static void *init_plugin (xine_t *xine, void *data) { vorbis_class_t *this; - this = (vorbis_class_t *) xine_xmalloc (sizeof (vorbis_class_t)); + this = (vorbis_class_t *) calloc(1, sizeof(vorbis_class_t)); this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index a3bdba74b..5cee51764 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -1523,7 +1523,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 +1558,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..e0e0883dc 100644 --- a/src/libxinevdec/foovideo.c +++ b/src/libxinevdec/foovideo.c @@ -206,7 +206,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 +256,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..d41a958d8 100644 --- a/src/libxinevdec/gdkpixbuf.c +++ b/src/libxinevdec/gdkpixbuf.c @@ -236,7 +236,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 +277,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..51e5d0309 100644 --- a/src/libxinevdec/image.c +++ b/src/libxinevdec/image.c @@ -212,7 +212,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 +255,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..a94e4b4a1 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -398,7 +398,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 +432,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..49b2363fb 100644 --- a/src/libxinevdec/yuv.c +++ b/src/libxinevdec/yuv.c @@ -321,7 +321,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 +355,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; diff --git a/src/post/audio/stretch.c b/src/post/audio/stretch.c index 5aa7a0617..8be58d8c5 100644 --- a/src/post/audio/stretch.c +++ b/src/post/audio/stretch.c @@ -155,7 +155,7 @@ static void stretchscr_exit (scr_plugin_t *scr) { static stretchscr_t* stretchscr_init (double *stretch_factor) { stretchscr_t *this; - this = (stretchscr_t *) xine_xmalloc(sizeof(stretchscr_t)); + this = calloc(1, sizeof(stretchscr_t)); this->scr.interface_version = 3; this->scr.get_priority = stretchscr_get_priority; @@ -620,7 +620,7 @@ static post_plugin_t *stretch_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_stretch_t *this = (post_plugin_stretch_t *)xine_xmalloc(sizeof(post_plugin_stretch_t)); + post_plugin_stretch_t *this = calloc(1, sizeof(post_plugin_stretch_t)); post_in_t *input; post_out_t *output; xine_post_in_t *input_api; diff --git a/src/post/audio/upmix.c b/src/post/audio/upmix.c index e1b2afbe3..725439c1f 100644 --- a/src/post/audio/upmix.c +++ b/src/post/audio/upmix.c @@ -181,7 +181,7 @@ static int upmix_port_open(xine_audio_port_t *port_gen, xine_stream_t *stream, } pthread_mutex_lock (&this->lock); - this->sub = xine_xmalloc(sizeof(af_sub_t)); + this->sub = calloc(1, sizeof(af_sub_t)); if (!this->sub) { pthread_mutex_unlock (&this->lock); return 0; @@ -379,7 +379,7 @@ static post_plugin_t *upmix_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_upmix_t *this = (post_plugin_upmix_t *)xine_xmalloc(sizeof(post_plugin_upmix_t)); + post_plugin_upmix_t *this = calloc(1, sizeof(post_plugin_upmix_t)); post_in_t *input; post_out_t *output; xine_post_in_t *input_api; diff --git a/src/post/audio/upmix_mono.c b/src/post/audio/upmix_mono.c index 195831123..caf99a309 100644 --- a/src/post/audio/upmix_mono.c +++ b/src/post/audio/upmix_mono.c @@ -293,7 +293,7 @@ static post_plugin_t *upmix_mono_open_plugin(post_class_t *class_gen, int inputs xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_upmix_mono_t *this = (post_plugin_upmix_mono_t *)xine_xmalloc(sizeof(post_plugin_upmix_mono_t)); + post_plugin_upmix_mono_t *this = calloc(1, sizeof(post_plugin_upmix_mono_t)); post_in_t *input; post_out_t *output; xine_post_in_t *input_api; diff --git a/src/post/audio/volnorm.c b/src/post/audio/volnorm.c index 783c1e26d..07d06fe1c 100644 --- a/src/post/audio/volnorm.c +++ b/src/post/audio/volnorm.c @@ -407,7 +407,7 @@ static post_plugin_t *volnorm_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_volnorm_t *this = (post_plugin_volnorm_t *)xine_xmalloc(sizeof(post_plugin_volnorm_t)); + post_plugin_volnorm_t *this = calloc(1, sizeof(post_plugin_volnorm_t)); post_in_t *input; post_out_t *output; xine_post_in_t *input_api; diff --git a/src/post/deinterlace/xine_plugin.c b/src/post/deinterlace/xine_plugin.c index 477e6812b..8115198af 100644 --- a/src/post/deinterlace/xine_plugin.c +++ b/src/post/deinterlace/xine_plugin.c @@ -291,7 +291,7 @@ static int deinterlace_draw(vo_frame_t *frame, xine_stream_t *stream) static void *deinterlace_init_plugin(xine_t *xine, void *data) { - post_class_deinterlace_t *class = (post_class_deinterlace_t *)xine_xmalloc(sizeof(post_class_deinterlace_t)); + post_class_deinterlace_t *class = calloc(1, sizeof(post_class_deinterlace_t)); uint32_t config_flags = xine_mm_accel(); int i; @@ -364,7 +364,7 @@ static post_plugin_t *deinterlace_open_plugin(post_class_t *class_gen, int input xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_deinterlace_t *this = (post_plugin_deinterlace_t *)xine_xmalloc(sizeof(post_plugin_deinterlace_t)); + post_plugin_deinterlace_t *this = calloc(1, sizeof(post_plugin_deinterlace_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/goom/xine_goom.c b/src/post/goom/xine_goom.c index 8cd06dbd6..5cd5406b2 100644 --- a/src/post/goom/xine_goom.c +++ b/src/post/goom/xine_goom.c @@ -187,7 +187,7 @@ static void csc_method_changed_cb(void *data, xine_cfg_entry_t *cfg) { static void *goom_init_plugin(xine_t *xine, void *data) { - post_class_goom_t *this = (post_class_goom_t *)xine_xmalloc(sizeof(post_class_goom_t)); + post_class_goom_t *this = calloc(1, sizeof(post_class_goom_t)); config_values_t *cfg; if (!this) @@ -234,7 +234,7 @@ static post_plugin_t *goom_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_goom_t *this = (post_plugin_goom_t *)xine_xmalloc(sizeof(post_plugin_goom_t)); + post_plugin_goom_t *this = calloc(1, sizeof(post_plugin_goom_t)); post_class_goom_t *class = (post_class_goom_t*) class_gen; post_in_t *input; post_out_t *output; diff --git a/src/post/mosaico/mosaico.c b/src/post/mosaico/mosaico.c index 40f0ffb4c..37551aba5 100644 --- a/src/post/mosaico/mosaico.c +++ b/src/post/mosaico/mosaico.c @@ -122,7 +122,7 @@ static int mosaico_draw(vo_frame_t *frame, xine_stream_t *stream); static void *mosaico_init_plugin(xine_t *xine, void *data) { - post_class_mosaico_t *this = (post_class_mosaico_t *)xine_xmalloc(sizeof(post_class_mosaico_t)); + post_class_mosaico_t *this = calloc(1, sizeof(post_class_mosaico_t)); if (!this) return NULL; @@ -140,7 +140,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_mosaico_t *this = (post_mosaico_t *)xine_xmalloc(sizeof(post_mosaico_t)); + post_mosaico_t *this = calloc(1, sizeof(post_mosaico_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; @@ -178,7 +178,7 @@ static post_plugin_t *mosaico_open_plugin(post_class_t *class_gen, int inputs, this->pip[i].y = 50; this->pip[i].w = 150; this->pip[i].h = 150; - this->pip[i].input_name = (char *)xine_xmalloc(sizeof("video in ") + 10); + this->pip[i].input_name = (char *)malloc(sizeof("video in ") + 10); snprintf(this->pip[i].input_name, sizeof("video in ") + 10, "video in %d", i+1); port = _x_post_intercept_video_port(&this->post, video_target[0], &input, NULL); diff --git a/src/post/mosaico/switch.c b/src/post/mosaico/switch.c index 8fec5ee77..a01c821b2 100644 --- a/src/post/mosaico/switch.c +++ b/src/post/mosaico/switch.c @@ -101,7 +101,7 @@ static int switch_draw(vo_frame_t *frame, xine_stream_t *stream); static void *switch_init_plugin(xine_t *xine, void *data) { - post_class_switch_t *this = (post_class_switch_t *)xine_xmalloc(sizeof(post_class_switch_t)); + post_class_switch_t *this = calloc(1, sizeof(post_class_switch_t)); if (!this) return NULL; @@ -119,7 +119,7 @@ static post_plugin_t *switch_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_switch_t *this = (post_switch_t *)xine_xmalloc(sizeof(post_switch_t)); + post_switch_t *this = calloc(1, sizeof(post_switch_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/planar/boxblur.c b/src/post/planar/boxblur.c index b7a6f524f..edad304a6 100644 --- a/src/post/planar/boxblur.c +++ b/src/post/planar/boxblur.c @@ -154,7 +154,7 @@ static post_plugin_t *boxblur_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_boxblur_t *this = (post_plugin_boxblur_t *)xine_xmalloc(sizeof(post_plugin_boxblur_t)); + post_plugin_boxblur_t *this = calloc(1, sizeof(post_plugin_boxblur_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/planar/denoise3d.c b/src/post/planar/denoise3d.c index fb3c1102b..74ed02250 100644 --- a/src/post/planar/denoise3d.c +++ b/src/post/planar/denoise3d.c @@ -194,7 +194,7 @@ static post_plugin_t *denoise3d_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_denoise3d_t *this = (post_plugin_denoise3d_t *)xine_xmalloc(sizeof(post_plugin_denoise3d_t)); + post_plugin_denoise3d_t *this = calloc(1, sizeof(post_plugin_denoise3d_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/planar/eq.c b/src/post/planar/eq.c index b2cf6e50f..92dae8e36 100644 --- a/src/post/planar/eq.c +++ b/src/post/planar/eq.c @@ -246,7 +246,7 @@ static post_plugin_t *eq_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_eq_t *this = (post_plugin_eq_t *)xine_xmalloc(sizeof(post_plugin_eq_t)); + post_plugin_eq_t *this = calloc(1, sizeof(post_plugin_eq_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/planar/eq2.c b/src/post/planar/eq2.c index 6b277c347..8894b9d06 100644 --- a/src/post/planar/eq2.c +++ b/src/post/planar/eq2.c @@ -427,7 +427,7 @@ static post_plugin_t *eq2_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_eq2_t *this = (post_plugin_eq2_t *)xine_xmalloc(sizeof(post_plugin_eq2_t)); + post_plugin_eq2_t *this = calloc(1, sizeof(post_plugin_eq2_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/planar/expand.c b/src/post/planar/expand.c index 67d449153..52bc2b37a 100644 --- a/src/post/planar/expand.c +++ b/src/post/planar/expand.c @@ -148,7 +148,7 @@ static post_plugin_t *expand_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_expand_t *this = (post_expand_t *)xine_xmalloc(sizeof(post_expand_t)); + post_expand_t *this = calloc(1, sizeof(post_expand_t)); post_in_t *input; xine_post_in_t *input_param; post_out_t *output; diff --git a/src/post/planar/fill.c b/src/post/planar/fill.c index 32a9d5dfb..98c572777 100644 --- a/src/post/planar/fill.c +++ b/src/post/planar/fill.c @@ -66,7 +66,7 @@ static post_plugin_t *fill_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t)); + post_plugin_t *this = calloc(1, sizeof(post_plugin_t)); post_in_t *input; post_out_t *output; post_video_port_t *port; diff --git a/src/post/planar/invert.c b/src/post/planar/invert.c index 1aa5c2a2e..d1f0c8d4e 100644 --- a/src/post/planar/invert.c +++ b/src/post/planar/invert.c @@ -67,7 +67,7 @@ static post_plugin_t *invert_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_t *this = (post_plugin_t *)xine_xmalloc(sizeof(post_plugin_t)); + post_plugin_t *this = calloc(1, sizeof(post_plugin_t)); post_in_t *input; post_out_t *output; post_video_port_t *port; diff --git a/src/post/planar/noise.c b/src/post/planar/noise.c index 8c04f2e72..e15c6fb4d 100644 --- a/src/post/planar/noise.c +++ b/src/post/planar/noise.c @@ -471,7 +471,7 @@ static post_plugin_t *noise_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_noise_t *this = (post_plugin_noise_t *)xine_xmalloc(sizeof(post_plugin_noise_t)); + post_plugin_noise_t *this = calloc(1, sizeof(post_plugin_noise_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/planar/pp.c b/src/post/planar/pp.c index e658dadd0..3c6fe8767 100644 --- a/src/post/planar/pp.c +++ b/src/post/planar/pp.c @@ -174,7 +174,7 @@ static post_plugin_t *pp_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_pp_t *this = (post_plugin_pp_t *)xine_xmalloc(sizeof(post_plugin_pp_t)); + post_plugin_pp_t *this = calloc(1, sizeof(post_plugin_pp_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/planar/unsharp.c b/src/post/planar/unsharp.c index b9b791a8e..e61d80076 100644 --- a/src/post/planar/unsharp.c +++ b/src/post/planar/unsharp.c @@ -287,7 +287,7 @@ static post_plugin_t *unsharp_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_unsharp_t *this = (post_plugin_unsharp_t *)xine_xmalloc(sizeof(post_plugin_unsharp_t)); + post_plugin_unsharp_t *this = calloc(1, sizeof(post_plugin_unsharp_t)); post_in_t *input; xine_post_in_t *input_api; post_out_t *output; diff --git a/src/post/visualizations/fftgraph.c b/src/post/visualizations/fftgraph.c index 5068bd37a..0cf27faf8 100644 --- a/src/post/visualizations/fftgraph.c +++ b/src/post/visualizations/fftgraph.c @@ -415,7 +415,7 @@ static post_plugin_t *fftgraph_open_plugin(post_class_t *class_gen, int inputs, xine_video_port_t **video_target) { post_class_fftgraph_t *class = (post_class_fftgraph_t *)class_gen; - post_plugin_fftgraph_t *this = (post_plugin_fftgraph_t *)xine_xmalloc(sizeof(post_plugin_fftgraph_t)); + post_plugin_fftgraph_t *this = calloc(1, sizeof(post_plugin_fftgraph_t)); post_in_t *input; post_out_t *output; post_out_t *outputv; diff --git a/src/post/visualizations/fftscope.c b/src/post/visualizations/fftscope.c index ba34437f5..2c6297a44 100644 --- a/src/post/visualizations/fftscope.c +++ b/src/post/visualizations/fftscope.c @@ -435,7 +435,7 @@ static post_plugin_t *fftscope_open_plugin(post_class_t *class_gen, int inputs, xine_audio_port_t **audio_target, xine_video_port_t **video_target) { - post_plugin_fftscope_t *this = (post_plugin_fftscope_t *)xine_xmalloc(sizeof(post_plugin_fftscope_t)); + post_plugin_fftscope_t *this = calloc(1, sizeof(post_plugin_fftscope_t)); post_class_fftscope_t *class = (post_class_fftscope_t *)class_gen; post_in_t *input; post_out_t *output; diff --git a/src/post/visualizations/fooviz.c b/src/post/visualizations/fooviz.c index 21854afc6..2219143be 100644 --- a/src/post/visualizations/fooviz.c +++ b/src/post/visualizations/fooviz.c @@ -247,7 +247,7 @@ static post_plugin_t *fooviz_open_plugin(post_class_t *class_gen, int inputs, xine_video_port_t **video_target) { post_class_fooviz_t *class = (post_class_fooviz_t *)class_gen; - post_plugin_fooviz_t *this = (post_plugin_fooviz_t *)xine_xmalloc(sizeof(post_plugin_fooviz_t)); + post_plugin_fooviz_t *this = calloc(1, sizeof(post_plugin_fooviz_t)); post_in_t *input; post_out_t *output; post_out_t *outputv; diff --git a/src/post/visualizations/oscope.c b/src/post/visualizations/oscope.c index a435604d4..099920b42 100644 --- a/src/post/visualizations/oscope.c +++ b/src/post/visualizations/oscope.c @@ -318,7 +318,7 @@ static post_plugin_t *oscope_open_plugin(post_class_t *class_gen, int inputs, xine_video_port_t **video_target) { post_class_oscope_t *class = (post_class_oscope_t *)class_gen; - post_plugin_oscope_t *this = (post_plugin_oscope_t *)xine_xmalloc(sizeof(post_plugin_oscope_t)); + post_plugin_oscope_t *this = calloc(1, sizeof(post_plugin_oscope_t)); post_in_t *input; post_out_t *output; post_out_t *outputv; diff --git a/src/video_out/video_out_aa.c b/src/video_out/video_out_aa.c index 012db9665..770b75a10 100644 --- a/src/video_out/video_out_aa.c +++ b/src/video_out/video_out_aa.c @@ -106,7 +106,7 @@ static vo_frame_t *aa_alloc_frame(vo_driver_t *this_gen) { /* aa_driver_t *this = (aa_driver_t*) this_gen; */ aa_frame_t *frame; - frame = (aa_frame_t *) xine_xmalloc (sizeof (aa_frame_t)); + frame = calloc(1, sizeof (aa_frame_t)); if (!frame) return NULL; @@ -276,7 +276,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi aa_class_t *class = (aa_class_t *) class_gen; aa_driver_t *this; - this = (aa_driver_t*) xine_xmalloc (sizeof (aa_driver_t)); + this = (aa_driver_t*) calloc(1, sizeof(aa_driver_t)); this->context = (aa_context*) visual_gen; @@ -316,7 +316,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { /* aa_context *context = (aa_context*) visual_gen; */ aa_class_t *this; - this = (aa_class_t *) xine_xmalloc(sizeof(aa_class_t)); + this = calloc(1, sizeof(aa_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_caca.c b/src/video_out/video_out_caca.c index 866eabcd8..3eec45211 100644 --- a/src/video_out/video_out_caca.c +++ b/src/video_out/video_out_caca.c @@ -120,7 +120,7 @@ static vo_frame_t *caca_alloc_frame(vo_driver_t *this_gen) { caca_driver_t *this = (caca_driver_t*) this_gen; caca_frame_t *frame; - frame = (caca_frame_t *) xine_xmalloc (sizeof (caca_frame_t)); + frame = calloc(1, sizeof (caca_frame_t)); if (!frame) return NULL; @@ -278,7 +278,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi caca_class_t *class = (caca_class_t *) class_gen; caca_driver_t *this; - this = (caca_driver_t*) xine_xmalloc (sizeof (caca_driver_t)); + this = calloc(1, sizeof (caca_driver_t)); this->config = class->config; this->xine = class->xine; @@ -322,7 +322,7 @@ static void dispose_class (video_driver_class_t *this_gen) { 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 = calloc(1, sizeof(caca_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c index e6e333a0c..eea614779 100644 --- a/src/video_out/video_out_directfb.c +++ b/src/video_out/video_out_directfb.c @@ -232,7 +232,7 @@ static vo_frame_t *directfb_alloc_frame (vo_driver_t *this_gen) { directfb_driver_t *this = (directfb_driver_t *) this_gen; directfb_frame_t *frame; - frame = (directfb_frame_t *) xine_xmalloc (sizeof (directfb_frame_t)); + frame = (directfb_frame_t *) calloc(1, sizeof(directfb_frame_t)); if (!frame) { xprintf (this->xine, XINE_VERBOSITY_DEBUG, "video_out_directfb: directfb_alloc_frame: out of memory\n"); @@ -1753,7 +1753,7 @@ static vo_driver_t *open_plugin_fb (video_driver_class_t *class_gen, const void DFBDisplayLayerID id; DFBResult ret; - this = xine_xmalloc (sizeof (directfb_driver_t)); + this = calloc(1, sizeof(directfb_driver_t)); if (!this) return NULL; @@ -1908,7 +1908,7 @@ static void *init_class_fb (xine_t *xine, void *visual_gen) { return NULL; } - this = (directfb_class_t *) xine_xmalloc (sizeof (directfb_class_t)); + this = (directfb_class_t *) calloc(1, sizeof(directfb_class_t)); this->driver_class.open_plugin = open_plugin_fb; this->driver_class.get_identifier = get_identifier_fb; this->driver_class.get_description = get_description_fb; @@ -1939,7 +1939,7 @@ static vo_driver_t *open_plugin_x11 (video_driver_class_t *class_gen, const void DFBDisplayLayerID id = DLID_PRIMARY; DFBResult ret; - this = xine_xmalloc (sizeof (directfb_driver_t)); + this = calloc(1, sizeof(directfb_driver_t)); if (!this) return NULL; @@ -2127,7 +2127,7 @@ static void *init_class_x11 (xine_t *xine, void *visual_gen) { if (strcmp (XServerVendor (visual->display), "Denis Oliver Kropp")) return NULL; - this = (directfb_class_t *) xine_xmalloc (sizeof (directfb_class_t)); + this = (directfb_class_t *) calloc(1, sizeof(directfb_class_t)); this->driver_class.open_plugin = open_plugin_x11; this->driver_class.get_identifier = get_identifier_x11; this->driver_class.get_description = get_description_x11; diff --git a/src/video_out/video_out_directx.c b/src/video_out/video_out_directx.c index 11ee709e1..f1136eab0 100644 --- a/src/video_out/video_out_directx.c +++ b/src/video_out/video_out_directx.c @@ -863,7 +863,7 @@ static vo_frame_t * win32_alloc_frame( vo_driver_t * vo_driver ) { win32_frame_t *win32_frame; - win32_frame = ( win32_frame_t * ) xine_xmalloc( sizeof( win32_frame_t ) ); + win32_frame = calloc(1, sizeof(win32_frame_t)); if (!win32_frame) return NULL; @@ -1183,7 +1183,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *wi /*vo_driver_t *init_video_out_plugin( config_values_t * config, void * win32_visual )*/ { directx_class_t *class = (directx_class_t *)class_gen; - win32_driver_t *win32_driver = ( win32_driver_t * ) xine_xmalloc ( sizeof( win32_driver_t ) ); + win32_driver_t *win32_driver = calloc(1, sizeof(win32_driver_t)); _x_alphablend_init(&win32_driver->alphablend_extra_data, class->xine); @@ -1249,7 +1249,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { /* * from this point on, nothing should go wrong anymore */ - directx = (directx_class_t *) xine_xmalloc (sizeof (directx_class_t)); + directx = calloc(1, sizeof (directx_class_t)); directx->driver_class.open_plugin = open_plugin; directx->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c index 6a331c910..d67b0870d 100644 --- a/src/video_out/video_out_fb.c +++ b/src/video_out/video_out_fb.c @@ -221,7 +221,7 @@ static vo_frame_t *fb_alloc_frame(vo_driver_t *this_gen) this->total_num_native_buffers <= this->used_num_buffers) return 0; - frame = (fb_frame_t *)xine_xmalloc(sizeof(fb_frame_t)); + frame = calloc(1, sizeof(fb_frame_t)); if(!frame) return NULL; @@ -992,7 +992,7 @@ static vo_driver_t *fb_open_plugin(video_driver_class_t *class_gen, config = class->config; /* allocate plugin struct */ - this = (fb_driver_t *) xine_xmalloc(sizeof(fb_driver_t)); + this = calloc(1, sizeof(fb_driver_t)); if(!this) return NULL; @@ -1075,7 +1075,7 @@ static void fb_dispose_class(video_driver_class_t *this_gen) static void *fb_init_class(xine_t *xine, void *visual_gen) { - fb_class_t *this = (fb_class_t *)xine_xmalloc(sizeof(fb_class_t)); + fb_class_t *this = calloc(1, sizeof(fb_class_t)); this->driver_class.open_plugin = fb_open_plugin; this->driver_class.get_identifier = fb_get_identifier; diff --git a/src/video_out/video_out_macosx.m b/src/video_out/video_out_macosx.m index a13de239f..b5b4d731c 100644 --- a/src/video_out/video_out_macosx.m +++ b/src/video_out/video_out_macosx.m @@ -97,7 +97,7 @@ static vo_frame_t *macosx_alloc_frame(vo_driver_t *vo_driver) { /* macosx_driver_t *this = (macosx_driver_t *) vo_driver; */ macosx_frame_t *frame; - frame = (macosx_frame_t *) xine_xmalloc(sizeof(macosx_frame_t)); + frame = calloc(1, sizeof(macosx_frame_t)); if(!frame) return NULL; @@ -320,7 +320,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void * macosx_driver_t *driver; XineOpenGLView *view = (XineOpenGLView *) visual; - driver = (macosx_driver_t *) xine_xmalloc(sizeof(macosx_driver_t)); + driver = calloc(1, sizeof(macosx_driver_t)); driver->config = class->config; driver->xine = class->xine; @@ -366,7 +366,7 @@ static void dispose_class (video_driver_class_t *driver_class) { static void *init_class (xine_t *xine, void *visual) { macosx_class_t *this; - this = (macosx_class_t *) xine_xmalloc(sizeof(macosx_class_t)); + this = calloc(1, sizeof(macosx_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_none.c b/src/video_out/video_out_none.c index 5f2424a60..0de6e34e8 100644 --- a/src/video_out/video_out_none.c +++ b/src/video_out/video_out_none.c @@ -88,7 +88,7 @@ static vo_frame_t *none_alloc_frame(vo_driver_t *vo_driver) { /* none_driver_t *this = (none_driver_t *) vo_driver; */ none_frame_t *frame; - frame = (none_frame_t *) xine_xmalloc(sizeof(none_frame_t)); + frame = calloc(1, sizeof(none_frame_t)); if(!frame) return NULL; @@ -243,7 +243,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *driver_class, const void * none_class_t *class = (none_class_t *) driver_class; none_driver_t *driver; - driver = (none_driver_t *) xine_xmalloc(sizeof(none_driver_t)); + driver = calloc(1, sizeof(none_driver_t)); driver->config = class->config; driver->xine = class->xine; @@ -286,7 +286,7 @@ static void dispose_class (video_driver_class_t *driver_class) { static void *init_class (xine_t *xine, void *visual) { none_class_t *this; - this = (none_class_t *) xine_xmalloc(sizeof(none_class_t)); + this = calloc(1, sizeof(none_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 54696f452..a82bb8f18 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -1281,7 +1281,7 @@ static vo_frame_t *opengl_alloc_frame (vo_driver_t *this_gen) { opengl_frame_t *frame; opengl_driver_t *this = (opengl_driver_t *) this_gen; - frame = (opengl_frame_t *) xine_xmalloc (sizeof (opengl_frame_t)); + frame = (opengl_frame_t *) calloc(1, sizeof(opengl_frame_t)); if (!frame) return NULL; @@ -1820,7 +1820,7 @@ static vo_driver_t *opengl_open_plugin (video_driver_class_t *class_gen, const v char **render_fun_names; int i; - this = (opengl_driver_t *) xine_xmalloc (sizeof (opengl_driver_t)); + this = (opengl_driver_t *) calloc(1, sizeof(opengl_driver_t)); if (!this) return NULL; @@ -1970,7 +1970,7 @@ static void opengl_dispose_class (video_driver_class_t *this_gen) { } static void *opengl_init_class (xine_t *xine, void *visual_gen) { - opengl_class_t *this = (opengl_class_t *) xine_xmalloc (sizeof (opengl_class_t)); + opengl_class_t *this = (opengl_class_t *) calloc(1, sizeof(opengl_class_t)); this->driver_class.open_plugin = opengl_open_plugin; this->driver_class.get_identifier = opengl_get_identifier; diff --git a/src/video_out/video_out_pgx32.c b/src/video_out/video_out_pgx32.c index d903efc89..45a54cc76 100644 --- a/src/video_out/video_out_pgx32.c +++ b/src/video_out/video_out_pgx32.c @@ -386,7 +386,7 @@ static vo_frame_t *pgx32_alloc_frame(vo_driver_t *this_gen) /*pgx32_driver_t *this = (pgx32_driver_t *)(void *)this_gen;*/ pgx32_frame_t *frame; - frame = (pgx32_frame_t *) xine_xmalloc(sizeof(pgx32_frame_t)); + frame = calloc(1, sizeof(pgx32_frame_t)); if (!frame) { return NULL; } @@ -800,7 +800,7 @@ static vo_driver_t *pgx32_init_driver(video_driver_class_t *class_gen, const voi pgx32_driver_class_t *class = (pgx32_driver_class_t *)(void *)class_gen; pgx32_driver_t *this; - this = (pgx32_driver_t *)xine_xmalloc(sizeof(pgx32_driver_t)); + this = calloc(1, sizeof(pgx32_driver_t)); if (!this) { return NULL; } @@ -869,7 +869,7 @@ static void *pgx32_init_class(xine_t *xine, void *visual_gen) { pgx32_driver_class_t *class; - class = (pgx32_driver_class_t *)xine_xmalloc(sizeof(pgx32_driver_class_t)); + class = calloc(1, sizeof(pgx32_driver_class_t)); if (!class) { return NULL; } diff --git a/src/video_out/video_out_pgx64.c b/src/video_out/video_out_pgx64.c index 4abb794d7..abda51e2b 100644 --- a/src/video_out/video_out_pgx64.c +++ b/src/video_out/video_out_pgx64.c @@ -561,7 +561,7 @@ static vo_frame_t *pgx64_alloc_frame(vo_driver_t *this_gen) /*pgx64_driver_t *this = (pgx64_driver_t *)(void *)this_gen;*/ pgx64_frame_t *frame; - frame = (pgx64_frame_t *) xine_xmalloc(sizeof(pgx64_frame_t)); + frame = calloc(1, sizeof(pgx64_frame_t)); if (!frame) { return NULL; } @@ -1352,7 +1352,7 @@ static vo_driver_t *pgx64_init_driver(video_driver_class_t *class_gen, const voi struct fbgattr attr; long page_size; - this = (pgx64_driver_t *)xine_xmalloc(sizeof(pgx64_driver_t)); + this = calloc(1, sizeof(pgx64_driver_t)); if (!this) { return NULL; } @@ -1493,7 +1493,7 @@ static void *pgx64_init_class(xine_t *xine, void *visual_gen) { pgx64_driver_class_t *class; - class = (pgx64_driver_class_t *)xine_xmalloc(sizeof(pgx64_driver_class_t)); + class = calloc(1, sizeof(pgx64_driver_class_t)); if (!class) { return NULL; } diff --git a/src/video_out/video_out_raw.c b/src/video_out/video_out_raw.c index 29d93d794..45cfc1eda 100644 --- a/src/video_out/video_out_raw.c +++ b/src/video_out/video_out_raw.c @@ -292,7 +292,7 @@ static vo_frame_t *raw_alloc_frame (vo_driver_t *this_gen) raw_frame_t *frame; raw_driver_t *this = (raw_driver_t *) this_gen; - frame = (raw_frame_t *) xine_xmalloc (sizeof (raw_frame_t)); + frame = (raw_frame_t *) calloc(1, sizeof(raw_frame_t)); if (!frame) return NULL; @@ -505,7 +505,7 @@ static vo_driver_t *raw_open_plugin (video_driver_class_t *class_gen, const void raw_driver_t *this; int i; - this = (raw_driver_t *) xine_xmalloc (sizeof (raw_driver_t)); + this = (raw_driver_t *) calloc(1, sizeof(raw_driver_t)); if (!this) return NULL; @@ -580,7 +580,7 @@ static void raw_dispose_class (video_driver_class_t *this_gen) static void *raw_init_class (xine_t *xine, void *visual_gen) { - raw_class_t *this = (raw_class_t *) xine_xmalloc (sizeof (raw_class_t)); + raw_class_t *this = (raw_class_t *) calloc(1, sizeof(raw_class_t)); this->driver_class.open_plugin = raw_open_plugin; this->driver_class.get_identifier = raw_get_identifier; diff --git a/src/video_out/video_out_sdl.c b/src/video_out/video_out_sdl.c index 6705b4176..b53d1d31c 100644 --- a/src/video_out/video_out_sdl.c +++ b/src/video_out/video_out_sdl.c @@ -138,7 +138,7 @@ static vo_frame_t *sdl_alloc_frame (vo_driver_t *this_gen) { /* sdl_driver_t *this = (sdl_driver_t *) this_gen; */ sdl_frame_t *frame ; - frame = (sdl_frame_t *) xine_xmalloc (sizeof (sdl_frame_t)); + frame = (sdl_frame_t *) calloc(1, sizeof(sdl_frame_t)); if (!frame) return NULL; @@ -475,7 +475,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi XWindowAttributes window_attributes; #endif - this = (sdl_driver_t *) xine_xmalloc (sizeof (sdl_driver_t)); + this = (sdl_driver_t *) calloc(1, sizeof(sdl_driver_t)); if (!this) return NULL; @@ -596,7 +596,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { } SDL_QuitSubSystem (SDL_INIT_VIDEO); - this = (sdl_class_t*) xine_xmalloc (sizeof (sdl_class_t)); + this = (sdl_class_t*) calloc(1, sizeof(sdl_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_stk.c b/src/video_out/video_out_stk.c index dfc4ae385..00dd80251 100644 --- a/src/video_out/video_out_stk.c +++ b/src/video_out/video_out_stk.c @@ -133,7 +133,7 @@ static vo_frame_t *stk_alloc_frame(vo_driver_t *this_gen) { stk_frame_t* frame; //printf("video_out_stk: alloc_frame()\n"); - frame = (stk_frame_t *) xine_xmalloc(sizeof(stk_frame_t)); + frame = calloc(1, sizeof(stk_frame_t)); if (!frame) return NULL; @@ -389,7 +389,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis //printf("video_out_stk: open_plugin()\n"); - this = (stk_driver_t *) xine_xmalloc (sizeof (stk_driver_t)); + this = calloc(1, sizeof (stk_driver_t)); if (!this) return NULL; @@ -463,7 +463,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { //printf("video_out_stk: init_class()\n"); - this = (stk_class_t *) xine_xmalloc(sizeof(stk_class_t)); + this = calloc(1, sizeof(stk_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c index b1fadbd58..f66817f36 100644 --- a/src/video_out/video_out_syncfb.c +++ b/src/video_out/video_out_syncfb.c @@ -478,7 +478,7 @@ static vo_frame_t* syncfb_alloc_frame(vo_driver_t* this_gen) /* syncfb_driver_t *this = (syncfb_driver_t *) this_gen; */ syncfb_frame_t *frame; - frame = (syncfb_frame_t *) xine_xmalloc(sizeof(syncfb_frame_t)); + frame = calloc(1, sizeof(syncfb_frame_t)); if(!frame) return NULL; @@ -882,7 +882,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi display = visual->display; - if(!(this = xine_xmalloc(sizeof (syncfb_driver_t)))) + if(!(this = calloc(1, sizeof (syncfb_driver_t)))) return NULL; _x_alphablend_init(&this->alphablend_extra_data, class->xine); @@ -1105,7 +1105,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { /* * from this point on, nothing should go wrong anymore */ - this = (syncfb_class_t *) xine_xmalloc (sizeof (syncfb_class_t)); + this = calloc(1, sizeof (syncfb_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c index 9e3f870b1..482841a09 100644 --- a/src/video_out/video_out_vidix.c +++ b/src/video_out/video_out_vidix.c @@ -370,7 +370,7 @@ static vo_frame_t *vidix_alloc_frame (vo_driver_t *this_gen) { /* vidix_driver_t *this = (vidix_driver_t *) this_gen; */ vidix_frame_t *frame ; - frame = (vidix_frame_t *) xine_xmalloc (sizeof (vidix_frame_t)); + frame = (vidix_frame_t *) calloc(1, sizeof(vidix_frame_t)); if (!frame) return NULL; @@ -947,7 +947,7 @@ static vidix_driver_t *open_plugin (video_driver_class_t *class_gen) { vidix_driver_t *this; int err; - this = (vidix_driver_t *) xine_xmalloc (sizeof (vidix_driver_t)); + this = (vidix_driver_t *) calloc(1, sizeof(vidix_driver_t)); if (!this) return NULL; @@ -1089,7 +1089,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { vidix_class_t *this; int err; - this = (vidix_class_t *) xine_xmalloc (sizeof (vidix_class_t)); + this = (vidix_class_t *) calloc(1, sizeof(vidix_class_t)); if (!this) return NULL; diff --git a/src/video_out/video_out_xcbshm.c b/src/video_out/video_out_xcbshm.c index 2ac579555..a5282a24f 100644 --- a/src/video_out/video_out_xcbshm.c +++ b/src/video_out/video_out_xcbshm.c @@ -295,7 +295,7 @@ static vo_frame_t *xshm_alloc_frame (vo_driver_t *this_gen) { xshm_frame_t *frame; xshm_driver_t *this = (xshm_driver_t *) this_gen; - frame = (xshm_frame_t *) xine_xmalloc (sizeof (xshm_frame_t)); + frame = (xshm_frame_t *) calloc(1, sizeof(xshm_frame_t)); if (!frame) return NULL; @@ -1015,7 +1015,7 @@ static vo_driver_t *xshm_open_plugin(video_driver_class_t *class_gen, const void const xcb_query_extension_reply_t *query_extension_reply; - this = (xshm_driver_t *) xine_xmalloc (sizeof (xshm_driver_t)); + this = (xshm_driver_t *) calloc(1, sizeof(xshm_driver_t)); if (!this) return NULL; @@ -1250,7 +1250,7 @@ static void xshm_dispose_class (video_driver_class_t *this_gen) { } static void *xshm_init_class (xine_t *xine, void *visual_gen) { - xshm_class_t *this = (xshm_class_t *) xine_xmalloc (sizeof (xshm_class_t)); + xshm_class_t *this = (xshm_class_t *) calloc(1, sizeof(xshm_class_t)); this->driver_class.open_plugin = xshm_open_plugin; this->driver_class.get_identifier = xshm_get_identifier; diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index f83512bd0..a4a3c3812 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -186,7 +186,7 @@ static vo_frame_t *xv_alloc_frame (vo_driver_t *this_gen) { /* xv_driver_t *this = (xv_driver_t *) this_gen; */ xv_frame_t *frame ; - frame = (xv_frame_t *) xine_xmalloc (sizeof (xv_frame_t)); + frame = (xv_frame_t *) calloc(1, sizeof(xv_frame_t)); if (!frame) return NULL; @@ -1295,7 +1295,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis xcb_xv_adaptor_info_iterator_t adaptor_it; xcb_xv_image_format_info_iterator_t format_it; - this = (xv_driver_t *) xine_xmalloc (sizeof (xv_driver_t)); + this = (xv_driver_t *) calloc(1, sizeof(xv_driver_t)); if (!this) return NULL; @@ -1629,7 +1629,7 @@ static void dispose_class (video_driver_class_t *this_gen) { } static void *init_class (xine_t *xine, void *visual_gen) { - xv_class_t *this = (xv_class_t *) xine_xmalloc (sizeof (xv_class_t)); + xv_class_t *this = (xv_class_t *) calloc(1, sizeof(xv_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_xshm.c b/src/video_out/video_out_xshm.c index ec97aa5c1..74791f145 100644 --- a/src/video_out/video_out_xshm.c +++ b/src/video_out/video_out_xshm.c @@ -387,7 +387,7 @@ static vo_frame_t *xshm_alloc_frame (vo_driver_t *this_gen) { xshm_frame_t *frame; xshm_driver_t *this = (xshm_driver_t *) this_gen; - frame = (xshm_frame_t *) xine_xmalloc (sizeof (xshm_frame_t)); + frame = (xshm_frame_t *) calloc(1, sizeof(xshm_frame_t)); if (!frame) return NULL; @@ -1083,7 +1083,7 @@ static vo_driver_t *xshm_open_plugin_2 (video_driver_class_t *class_gen, const v int cpu_byte_order; XColor dummy; - this = (xshm_driver_t *) xine_xmalloc (sizeof (xshm_driver_t)); + this = (xshm_driver_t *) calloc(1, sizeof(xshm_driver_t)); if (!this) return NULL; @@ -1310,7 +1310,7 @@ static void xshm_dispose_class (video_driver_class_t *this_gen) { } static void *xshm_init_class (xine_t *xine, void *visual_gen) { - xshm_class_t *this = (xshm_class_t *) xine_xmalloc (sizeof (xshm_class_t)); + xshm_class_t *this = (xshm_class_t *) calloc(1, sizeof(xshm_class_t)); this->driver_class.open_plugin = xshm_open_plugin_old; this->driver_class.get_identifier = xshm_get_identifier; diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index 65559c16f..e1f6d0de0 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -208,7 +208,7 @@ static vo_frame_t *xv_alloc_frame (vo_driver_t *this_gen) { /* xv_driver_t *this = (xv_driver_t *) this_gen; */ xv_frame_t *frame ; - frame = (xv_frame_t *) xine_xmalloc (sizeof (xv_frame_t)); + frame = (xv_frame_t *) calloc(1, sizeof(xv_frame_t)); if (!frame) return NULL; @@ -1340,7 +1340,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * XvAdaptorInfo *adaptor_info; unsigned int adaptor_num; - this = (xv_driver_t *) xine_xmalloc (sizeof (xv_driver_t)); + this = (xv_driver_t *) calloc(1, sizeof(xv_driver_t)); if (!this) return NULL; @@ -1712,7 +1712,7 @@ static void dispose_class (video_driver_class_t *this_gen) { } static void *init_class (xine_t *xine, void *visual_gen) { - xv_class_t *this = (xv_class_t *) xine_xmalloc (sizeof (xv_class_t)); + xv_class_t *this = (xv_class_t *) calloc(1, sizeof(xv_class_t)); this->driver_class.open_plugin = open_plugin_old; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/video_out_xvmc.c b/src/video_out/video_out_xvmc.c index a17e4d6a0..890e079a6 100644 --- a/src/video_out/video_out_xvmc.c +++ b/src/video_out/video_out_xvmc.c @@ -556,7 +556,7 @@ static vo_frame_t *xvmc_alloc_frame (vo_driver_t *this_gen) { lprintf ("xvmc_alloc_frame\n"); - frame = (xvmc_frame_t *) xine_xmalloc (sizeof (xvmc_frame_t)); + frame = calloc(1, (sizeof (xvmc_frame_t)); if (!frame) return NULL; @@ -595,8 +595,8 @@ static cxid_t *xvmc_set_context (xvmc_driver_t *this, /* initialize block & macro block pointers first time */ if(macroblocks->blocks == NULL || macroblocks->macro_blocks == NULL) { - macroblocks->blocks = xine_xmalloc(sizeof(XvMCBlockArray)); - macroblocks->macro_blocks = xine_xmalloc(sizeof(XvMCMacroBlockArray)); + macroblocks->blocks = calloc(1, sizeof(XvMCBlockArray)); + macroblocks->macro_blocks = calloc(1, sizeof(XvMCMacroBlockArray)); lprintf("macroblocks->blocks %lx ->macro_blocks %lx\n", macroblocks->blocks,macroblocks->macro_blocks); @@ -1348,7 +1348,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi display = visual->display; /* TODO ??? */ - this = (xvmc_driver_t *) xine_xmalloc (sizeof (xvmc_driver_t)); + this = calloc(1, sizeof (xvmc_driver_t)); if (!this) return NULL; diff --git a/src/video_out/video_out_xxmc.c b/src/video_out/video_out_xxmc.c index 28679e95d..07dafa12d 100644 --- a/src/video_out/video_out_xxmc.c +++ b/src/video_out/video_out_xxmc.c @@ -550,7 +550,7 @@ static vo_frame_t *xxmc_alloc_frame (vo_driver_t *this_gen) { xxmc_driver_t *this = (xxmc_driver_t *) this_gen; xxmc_frame_t *frame ; - frame = (xxmc_frame_t *) xine_xmalloc (sizeof (xxmc_frame_t)); + frame = calloc(1, sizeof (xxmc_frame_t)); if (!frame) return NULL; @@ -2373,7 +2373,7 @@ static vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *vi int use_more_frames; int use_unscaled; - this = (xxmc_driver_t *) xine_xmalloc (sizeof (xxmc_driver_t)); + this = calloc(1, sizeof (xxmc_driver_t)); if (!this) return NULL; @@ -2744,7 +2744,7 @@ static void dispose_class (video_driver_class_t *this_gen) { } static void *init_class (xine_t *xine, void *visual_gen) { - xxmc_class_t *this = (xxmc_class_t *) xine_xmalloc (sizeof (xxmc_class_t)); + xxmc_class_t *this = calloc(1, sizeof (xxmc_class_t)); this->driver_class.open_plugin = open_plugin; this->driver_class.get_identifier = get_identifier; diff --git a/src/video_out/x11osd.c b/src/video_out/x11osd.c index e0cb6f1f6..4d0e46287 100644 --- a/src/video_out/x11osd.c +++ b/src/video_out/x11osd.c @@ -245,7 +245,7 @@ x11osd_create (xine_t *xine, Display *display, int screen, Window window, enum x XSetWindowAttributes attr; XWindowAttributes getattr; - osd = xine_xmalloc (sizeof (x11osd)); + osd = calloc(1, sizeof(x11osd)); if (!osd) return NULL; diff --git a/src/video_out/xcbosd.c b/src/video_out/xcbosd.c index 4bb2b60af..d8cf119a2 100644 --- a/src/video_out/xcbosd.c +++ b/src/video_out/xcbosd.c @@ -238,7 +238,7 @@ xcbosd *xcbosd_create(xine_t *xine, xcb_connection_t *connection, xcb_screen_t * xcb_void_cookie_t generic_cookie; xcb_generic_error_t *generic_error; - osd = xine_xmalloc (sizeof (xcbosd)); + osd = calloc(1, sizeof(xcbosd)); if (!osd) return NULL; diff --git a/src/video_out/yuv2rgb.c b/src/video_out/yuv2rgb.c index c98dd518f..fb2d63e6c 100644 --- a/src/video_out/yuv2rgb.c +++ b/src/video_out/yuv2rgb.c @@ -3144,7 +3144,7 @@ static void yuy22rgb_c_init (yuv2rgb_factory_t *this) static yuv2rgb_t *yuv2rgb_create_converter (yuv2rgb_factory_t *factory) { - yuv2rgb_t *this = xine_xmalloc (sizeof (yuv2rgb_t)); + yuv2rgb_t *this = calloc(1, sizeof(yuv2rgb_t)); this->swapped = factory->swapped; this->cmap = factory->cmap; diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c index 4dcdb5af0..30756b017 100644 --- a/src/xine-engine/audio_out.c +++ b/src/xine-engine/audio_out.c @@ -294,7 +294,7 @@ static audio_fifo_t *fifo_new (xine_t *xine) { audio_fifo_t *fifo; - fifo = (audio_fifo_t *) xine_xmalloc (sizeof (audio_fifo_t)); + fifo = (audio_fifo_t *) calloc(1, sizeof(audio_fifo_t)); if (!fifo) return NULL; @@ -2051,7 +2051,7 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, static const char* resample_modes[] = {"auto", "off", "on", NULL}; static const char* av_sync_methods[] = {"metronom feedback", "resample", NULL}; - this = xine_xmalloc (sizeof (aos_t)) ; + this = calloc(1, sizeof(aos_t)) ; this->driver = driver; this->xine = xine; @@ -2085,7 +2085,7 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, this->grab_only = grab_only; this->flush_audio_driver = 0; this->discard_buffers = 0; - this->zero_space = xine_xmalloc (ZERO_BUF_SIZE * 4 * 6); /* MAX as 32bit, 6 channels. */ + this->zero_space = calloc (1, ZERO_BUF_SIZE * 4 * 6); /* MAX as 32bit, 6 channels. */ pthread_mutex_init( &this->flush_audio_driver_lock, NULL ); pthread_cond_init( &this->flush_audio_driver_reached, NULL ); @@ -2196,8 +2196,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, audio_buffer_t *buf; - buf = (audio_buffer_t *) xine_xmalloc (sizeof (audio_buffer_t)); - buf->mem = xine_xmalloc (AUDIO_BUF_SIZE); + buf = (audio_buffer_t *) calloc(1, sizeof(audio_buffer_t)); + buf->mem = calloc (1, AUDIO_BUF_SIZE); buf->mem_size = AUDIO_BUF_SIZE; buf->extra_info = malloc(sizeof(extra_info_t)); @@ -2211,8 +2211,8 @@ xine_audio_port_t *_x_ao_new_port (xine_t *xine, ao_driver_t *driver, audio_buffer_t *buf; - buf = (audio_buffer_t *) xine_xmalloc (sizeof (audio_buffer_t)); - buf->mem = xine_xmalloc (4*AUDIO_BUF_SIZE); + buf = (audio_buffer_t *) calloc(1, sizeof(audio_buffer_t)); + buf->mem = calloc(4, AUDIO_BUF_SIZE); buf->mem_size = 4*AUDIO_BUF_SIZE; buf->extra_info = malloc(sizeof(extra_info_t)); diff --git a/src/xine-engine/broadcaster.c b/src/xine-engine/broadcaster.c index 1d2f01366..5ce1619d1 100644 --- a/src/xine-engine/broadcaster.c +++ b/src/xine-engine/broadcaster.c @@ -323,7 +323,7 @@ broadcaster_t *_x_init_broadcaster(xine_stream_t *stream, int port) signal( SIGPIPE, SIG_IGN ); - this = xine_xmalloc(sizeof(broadcaster_t)); + this = calloc(1, sizeof(broadcaster_t)); this->port = port; this->stream = stream; this->msock = msock; diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c index 93ad75ba0..417fee745 100644 --- a/src/xine-engine/buffer.c +++ b/src/xine-engine/buffer.c @@ -500,7 +500,7 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) { int alignment = 2048; unsigned char *multi_buffer = NULL; - this = xine_xmalloc (sizeof (fifo_buffer_t)); + this = calloc(1, sizeof(fifo_buffer_t)); this->first = NULL; this->last = NULL; @@ -551,7 +551,7 @@ fifo_buffer_t *_x_fifo_buffer_new (int num_buffers, uint32_t buf_size) { for (i = 0; i<num_buffers; i++) { buf_element_t *buf; - buf = xine_xmalloc (sizeof (buf_element_t)); + buf = calloc(1, sizeof(buf_element_t)); buf->mem = multi_buffer; multi_buffer += buf_size; diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c index 2dc89f0af..ed3d2fcfb 100644 --- a/src/xine-engine/configfile.c +++ b/src/xine-engine/configfile.c @@ -323,7 +323,7 @@ static cfg_entry_t *config_add (config_values_t *this, const char *key, int exp_ cfg_entry_t *entry; - entry = (cfg_entry_t *) xine_xmalloc (sizeof (cfg_entry_t)); + entry = calloc (1, sizeof (cfg_entry_t)); entry->config = this; entry->key = strdup(key); entry->type = XINE_CONFIG_TYPE_UNKNOWN; @@ -1005,7 +1005,7 @@ void xine_config_save (xine_t *xine, const char *filename) { char *buf = NULL; size_t rlen; - buf = (char *) xine_xmalloc(config_stat.st_size + 1); + buf = (char *) malloc(config_stat.st_size + 1); if((rlen = fread(buf, 1, config_stat.st_size, f_config)) && ((off_t)rlen == config_stat.st_size)) { (void) fwrite(buf, 1, rlen, f_backup); } @@ -1204,7 +1204,7 @@ config_values_t *_x_config_init (void) { config_values_t *this; pthread_mutexattr_t attr; - if (!(this = xine_xmalloc(sizeof(config_values_t)))) { + if (!(this = calloc(1, sizeof(config_values_t)))) { printf ("configfile: could not allocate config object\n"); _x_abort(); diff --git a/src/xine-engine/demux.c b/src/xine-engine/demux.c index 24ee1b86d..51ed5b39d 100644 --- a/src/xine-engine/demux.c +++ b/src/xine-engine/demux.c @@ -440,7 +440,7 @@ int _x_demux_read_header( input_plugin_t *input, unsigned char *buffer, off_t si read_size = input->read(input, buffer, size); input->seek(input, 0, SEEK_SET); } else if (input->get_capabilities(input) & INPUT_CAP_PREVIEW) { - buf = xine_xmalloc(MAX_PREVIEW_SIZE); + buf = malloc(MAX_PREVIEW_SIZE); read_size = input->get_optional_data(input, buf, INPUT_OPTIONAL_DATA_PREVIEW); read_size = MIN (read_size, size); memcpy(buffer, buf, read_size); diff --git a/src/xine-engine/info_helper.c b/src/xine-engine/info_helper.c index 1ac4ed982..2d0ff4d8d 100644 --- a/src/xine-engine/info_helper.c +++ b/src/xine-engine/info_helper.c @@ -340,7 +340,7 @@ void _x_meta_info_set_utf8(xine_stream_t *stream, int info, const char *str) { void _x_meta_info_n_set(xine_stream_t *stream, int info, const char *buf, int len) { pthread_mutex_lock(&stream->meta_mutex); if(meta_valid(info) && len) { - char *str = xine_xmalloc(len + 1); + char *str = malloc(len + 1); snprintf(str, len + 1 , "%s", buf); meta_info_set_unlocked(stream, info, (const char *) &str[0]); @@ -376,7 +376,7 @@ void _x_meta_info_set_multi(xine_stream_t *stream, int info, ...) { if(len) { char *p, *meta; - p = meta = (char *) xine_xmalloc(len + 1); + p = meta = (char *) malloc(len + 1); n = 0; while(args[n]) { diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c index 30b1ba4aa..242449b9f 100644 --- a/src/xine-engine/input_cache.c +++ b/src/xine-engine/input_cache.c @@ -356,7 +356,7 @@ input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahe lprintf("mrl: %s\n", main_plugin->get_mrl(main_plugin)); - this = (cache_input_plugin_t *)xine_xmalloc(sizeof(cache_input_plugin_t)); + this = calloc(1, sizeof(cache_input_plugin_t)); if (!this) return NULL; diff --git a/src/xine-engine/input_rip.c b/src/xine-engine/input_rip.c index 0c185aa1b..200721dca 100644 --- a/src/xine-engine/input_rip.c +++ b/src/xine-engine/input_rip.c @@ -585,7 +585,7 @@ input_plugin_t *_x_rip_plugin_get_instance (xine_stream_t *stream, const char *f return NULL; } - this = (rip_input_plugin_t *)xine_xmalloc(sizeof(rip_input_plugin_t)); + this = calloc(1, sizeof(rip_input_plugin_t)); this->main_input_plugin = main_plugin; this->stream = stream; this->curpos = 0; diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index b8471e907..fce31baca 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -325,8 +325,8 @@ static void _insert_node (xine_t *this, return; } - entry = xine_xmalloc(sizeof(plugin_node_t)); - entry->info = xine_xmalloc(sizeof(plugin_info_t)); + entry = calloc(1, sizeof(plugin_node_t)); + entry->info = calloc(1, sizeof(plugin_info_t)); *(entry->info) = *info; entry->info->id = strdup(info->id); entry->info->init = info->init; @@ -339,7 +339,7 @@ static void _insert_node (xine_t *this, case PLUGIN_VIDEO_OUT: vo_old = info->special_info; - vo_new = xine_xmalloc(sizeof(vo_info_t)); + vo_new = calloc(1, sizeof(vo_info_t)); entry->priority = vo_new->priority = vo_old->priority; vo_new->visual_type = vo_old->visual_type; entry->info->special_info = vo_new; @@ -347,7 +347,7 @@ static void _insert_node (xine_t *this, case PLUGIN_AUDIO_OUT: ao_old = info->special_info; - ao_new = xine_xmalloc(sizeof(ao_info_t)); + ao_new = calloc(1, sizeof(ao_info_t)); entry->priority = ao_new->priority = ao_old->priority; entry->info->special_info = ao_new; break; @@ -356,7 +356,7 @@ static void _insert_node (xine_t *this, case PLUGIN_VIDEO_DECODER: case PLUGIN_SPU_DECODER: decoder_old = info->special_info; - decoder_new = xine_xmalloc(sizeof(decoder_info_t)); + decoder_new = calloc(1, sizeof(decoder_info_t)); if (decoder_old == NULL) { if (file) xprintf (this, XINE_VERBOSITY_DEBUG, @@ -369,7 +369,7 @@ static void _insert_node (xine_t *this, _x_abort(); } for (i=0; decoder_old->supported_types[i] != 0; ++i); - types = xine_xmalloc((i+1)*sizeof(uint32_t)); + types = calloc((i+1), sizeof(uint32_t)); for (i=0; decoder_old->supported_types[i] != 0; ++i){ types[i] = decoder_old->supported_types[i]; } @@ -402,14 +402,14 @@ static void _insert_node (xine_t *this, case PLUGIN_POST: post_old = info->special_info; - post_new = xine_xmalloc(sizeof(post_info_t)); + post_new = calloc(1, sizeof(post_info_t)); post_new->type = post_old->type; entry->info->special_info = post_new; break; case PLUGIN_DEMUX: demux_old = info->special_info; - demux_new = xine_xmalloc(sizeof(demuxer_info_t)); + demux_new = calloc(1, sizeof(demuxer_info_t)); if (demux_old) { entry->priority = demux_new->priority = demux_old->priority; @@ -426,7 +426,7 @@ static void _insert_node (xine_t *this, case PLUGIN_INPUT: input_old = info->special_info; - input_new = xine_xmalloc(sizeof(input_info_t)); + input_new = calloc(1, sizeof(input_info_t)); if (input_old) { entry->priority = input_new->priority = input_old->priority; @@ -468,7 +468,7 @@ static plugin_catalog_t *_new_catalog(void){ plugin_catalog_t *catalog; int i; - catalog = xine_xmalloc(sizeof(plugin_catalog_t)); + catalog = calloc(1, sizeof(plugin_catalog_t)); for (i = 0; i < PLUGIN_TYPE_MAX; i++) { catalog->plugin_lists[i] = xine_sarray_new(0, _plugin_node_comparator); @@ -941,8 +941,8 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) { if( node ) { xine_sarray_add (plugins, node); } - node = xine_xmalloc(sizeof(plugin_node_t)); - file = xine_xmalloc(sizeof(plugin_file_t)); + node = calloc(1, sizeof(plugin_node_t)); + file = calloc(1, sizeof(plugin_file_t)); node->file = file; file->filename = strdup(line+1); node->info = calloc(2, sizeof(plugin_info_t)); @@ -981,34 +981,34 @@ static void load_plugin_list(FILE *fp, xine_sarray_t *plugins) { case PLUGIN_VIDEO_OUT: node->info->special_info = vo_info = - xine_xmalloc(sizeof(vo_info_t)); + calloc(1, sizeof(vo_info_t)); break; case PLUGIN_AUDIO_OUT: node->info->special_info = ao_info = - xine_xmalloc(sizeof(ao_info_t)); + calloc(1, sizeof(ao_info_t)); break; case PLUGIN_DEMUX: node->info->special_info = demuxer_info = - xine_xmalloc(sizeof(demuxer_info_t)); + calloc(1, sizeof(demuxer_info_t)); break; case PLUGIN_INPUT: node->info->special_info = input_info = - xine_xmalloc(sizeof(input_info_t)); + calloc(1, sizeof(input_info_t)); break; case PLUGIN_AUDIO_DECODER: case PLUGIN_VIDEO_DECODER: case PLUGIN_SPU_DECODER: node->info->special_info = decoder_info = - xine_xmalloc(sizeof(decoder_info_t)); + calloc(1, sizeof(decoder_info_t)); break; case PLUGIN_POST: node->info->special_info = post_info = - xine_xmalloc(sizeof(post_info_t)); + calloc(1, sizeof(post_info_t)); break; } @@ -1073,13 +1073,13 @@ static void save_catalog (xine_t *this) { const char *relname = CACHE_CATALOG_FILE; const char *dirname = CACHE_CATALOG_DIR; - cachefile = (char *) xine_xmalloc(strlen(xine_get_homedir()) + - strlen(relname) + 2); + cachefile = (char *) malloc(strlen(xine_get_homedir()) + + strlen(relname) + 2); sprintf(cachefile, "%s/%s", xine_get_homedir(), relname); /* make sure homedir (~/.xine) exists */ - dirfile = (char *) xine_xmalloc(strlen(xine_get_homedir()) + - strlen(dirname) + 2); + dirfile = (char *) malloc(strlen(xine_get_homedir()) + + strlen(dirname) + 2); sprintf(dirfile, "%s/%s", xine_get_homedir(), dirname); mkdir (dirfile, 0755); free (dirfile); @@ -1107,8 +1107,8 @@ static void load_cached_catalog (xine_t *this) { char *cachefile; const char *relname = CACHE_CATALOG_FILE; - cachefile = (char *) xine_xmalloc(strlen(xine_get_homedir()) + - strlen(relname) + 2); + cachefile = (char *) malloc(strlen(xine_get_homedir()) + + strlen(relname) + 2); sprintf(cachefile, "%s/%s", xine_get_homedir(), relname); if( (fp = fopen(cachefile,"r")) != NULL ) { diff --git a/src/xine-engine/lrb.c b/src/xine-engine/lrb.c index 6da846a7c..6f8ac8479 100644 --- a/src/xine-engine/lrb.c +++ b/src/xine-engine/lrb.c @@ -30,7 +30,7 @@ lrb_t *lrb_new (int max_num_entries, lrb_t *this; - this = xine_xmalloc (sizeof (lrb_t)); + this = calloc(1, sizeof(lrb_t)); this->max_num_entries = max_num_entries; this->cur_num_entries = 0; diff --git a/src/xine-engine/metronom.c b/src/xine-engine/metronom.c index 5d3e0a12d..49ac5cdfb 100644 --- a/src/xine-engine/metronom.c +++ b/src/xine-engine/metronom.c @@ -175,8 +175,7 @@ static void unixscr_exit (scr_plugin_t *scr) { static scr_plugin_t* unixscr_init () { unixscr_t *this; - this = (unixscr_t *) xine_xmalloc(sizeof(unixscr_t)); - memset(this, 0, sizeof(*this)); + this = calloc(1, sizeof(unixscr_t)); this->scr.interface_version = 3; this->scr.get_priority = unixscr_get_priority; @@ -909,7 +908,7 @@ static void metronom_clock_exit (metronom_clock_t *this) { metronom_t * _x_metronom_init (int have_video, int have_audio, xine_t *xine) { - metronom_t *this = xine_xmalloc (sizeof (metronom_t)); + metronom_t *this = calloc(1, sizeof (metronom_t)); this->set_audio_rate = metronom_set_audio_rate; this->got_video_frame = metronom_got_video_frame; @@ -962,7 +961,7 @@ metronom_t * _x_metronom_init (int have_video, int have_audio, xine_t *xine) { metronom_clock_t *_x_metronom_clock_init(xine_t *xine) { - metronom_clock_t *this = (metronom_clock_t *) xine_xmalloc(sizeof(metronom_clock_t)); + metronom_clock_t *this = calloc(1, sizeof(metronom_clock_t)); int err; this->set_option = metronom_clock_set_option; diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index ef888e7a4..5de0de2cb 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -149,7 +149,7 @@ static osd_object_t *osd_new_object (osd_renderer_t *this, int width, int height pthread_mutex_lock (&this->osd_mutex); - osd = xine_xmalloc( sizeof(osd_object_t) ); + osd = calloc(1, sizeof(osd_object_t)); osd->renderer = this; osd->next = this->osds; this->osds = osd; @@ -670,7 +670,7 @@ static int osd_renderer_load_font(osd_renderer_t *this, char *filename) { /* fixme: check for all read errors... */ if( (fp = gzopen(filename,"rb")) != NULL ) { - font = xine_xmalloc( sizeof(osd_font_t) ); + font = calloc(1, sizeof(osd_font_t)); gzread(fp, font->name, sizeof(font->name) ); font->version = gzread_i16(fp); @@ -818,7 +818,7 @@ static int osd_renderer_unload_font(osd_renderer_t *this, char *fontname ) { #ifdef HAVE_FT2 static int osd_set_font_freetype2( osd_object_t *osd, const char *fontname, int size ) { if (!osd->ft2) { - osd->ft2 = xine_xmalloc(sizeof(osd_ft2context_t)); + osd->ft2 = calloc(1, sizeof(osd_ft2context_t)); if(FT_Init_FreeType( &osd->ft2->library )) { xprintf(osd->renderer->stream->xine, XINE_VERBOSITY_LOG, _("osd: cannot initialize ft2 library\n")); @@ -1413,7 +1413,7 @@ static void osd_preload_fonts (osd_renderer_t *this, char *path) { char *pathname; *p++ = '\0'; - font = xine_xmalloc( sizeof(osd_font_t) ); + font = calloc(1, sizeof(osd_font_t) ); strncpy(font->name, s, sizeof(font->name)); font->size = atoi(p); @@ -1421,7 +1421,7 @@ static void osd_preload_fonts (osd_renderer_t *this, char *path) { lprintf("font '%s' size %d is preloaded\n", font->name, font->size); - pathname = (char *) xine_xmalloc(strlen(path) + strlen(entry->d_name) + 2); + pathname = malloc(strlen(path) + strlen(entry->d_name) + 2); sprintf (pathname, "%s/%s", path, entry->d_name); font->filename = pathname; @@ -1579,9 +1579,9 @@ osd_renderer_t *_x_osd_renderer_init( xine_stream_t *stream ) { osd_renderer_t *this; char str[1024]; - this = xine_xmalloc(sizeof(osd_renderer_t)); + this = calloc(1, sizeof(osd_renderer_t)); this->stream = stream; - this->event.object.overlay = xine_xmalloc( sizeof(vo_overlay_t) ); + this->event.object.overlay = calloc(1, sizeof(vo_overlay_t)); pthread_mutex_init (&this->osd_mutex, NULL); diff --git a/src/xine-engine/post.c b/src/xine-engine/post.c index 5d8d67037..4d8032bc0 100644 --- a/src/xine-engine/post.c +++ b/src/xine-engine/post.c @@ -207,7 +207,7 @@ static int post_video_rewire(xine_post_out_t *output_gen, void *data) { post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_port_t *original, post_in_t **input, post_out_t **output) { - post_video_port_t *port = (post_video_port_t *)xine_xmalloc(sizeof(post_video_port_t)); + post_video_port_t *port = calloc(1, sizeof(post_video_port_t)); if (!port) return NULL; @@ -235,7 +235,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_ pthread_mutex_init(&port->free_frames_lock, NULL); if (input) { - *input = (post_in_t *)xine_xmalloc(sizeof(post_in_t)); + *input = calloc(1, sizeof(post_in_t)); if (!*input) return port; (*input)->xine_in.name = "video in"; (*input)->xine_in.type = XINE_POST_DATA_VIDEO; @@ -245,7 +245,7 @@ post_video_port_t *_x_post_intercept_video_port(post_plugin_t *post, xine_video_ } if (output) { - *output = (post_out_t *)xine_xmalloc(sizeof(post_out_t)); + *output = calloc(1, sizeof(post_out_t)); if (!*output) return port; (*output)->xine_out.name = "video out"; (*output)->xine_out.type = XINE_POST_DATA_VIDEO; @@ -353,7 +353,7 @@ vo_frame_t *_x_post_intercept_video_frame(vo_frame_t *frame, post_video_port_t * new_frame = port->free_frame_slots; port->free_frame_slots = new_frame->next; } else { - new_frame = (vo_frame_t *)xine_xmalloc(sizeof(vo_frame_t)); + new_frame = calloc(1, sizeof(vo_frame_t)); } pthread_mutex_unlock(&port->free_frames_lock); @@ -716,7 +716,7 @@ static int post_audio_rewire(xine_post_out_t *output_gen, void *data) { post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_port_t *original, post_in_t **input, post_out_t **output) { - post_audio_port_t *port = (post_audio_port_t *)xine_xmalloc(sizeof(post_audio_port_t)); + post_audio_port_t *port = calloc(1, sizeof(post_audio_port_t)); if (!port) return NULL; @@ -739,7 +739,7 @@ post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_ pthread_mutex_init(&port->usage_lock, NULL); if (input) { - *input = (post_in_t *)xine_xmalloc(sizeof(post_in_t)); + *input = calloc(1, sizeof(post_in_t)); if (!*input) return port; (*input)->xine_in.name = "audio in"; (*input)->xine_in.type = XINE_POST_DATA_AUDIO; @@ -749,7 +749,7 @@ post_audio_port_t *_x_post_intercept_audio_port(post_plugin_t *post, xine_audio_ } if (output) { - *output = (post_out_t *)xine_xmalloc(sizeof(post_out_t)); + *output = calloc(1, sizeof(post_out_t)); if (!*output) return port; (*output)->xine_out.name = "audio out"; (*output)->xine_out.type = XINE_POST_DATA_AUDIO; diff --git a/src/xine-engine/refcounter.c b/src/xine-engine/refcounter.c index 539abf3ed..8e952952b 100644 --- a/src/xine-engine/refcounter.c +++ b/src/xine-engine/refcounter.c @@ -30,7 +30,7 @@ refcounter_t* _x_new_refcounter(void *object, void (*destructor)(void *)) { refcounter_t *new_refcounter; - new_refcounter = (refcounter_t *) xine_xmalloc (sizeof (refcounter_t)); + new_refcounter = (refcounter_t *) calloc(1, sizeof(refcounter_t)); new_refcounter->count = 1; new_refcounter->object = object; new_refcounter->destructor = destructor; diff --git a/src/xine-engine/scratch.c b/src/xine-engine/scratch.c index 065f8fa0a..3be1c70ef 100644 --- a/src/xine-engine/scratch.c +++ b/src/xine-engine/scratch.c @@ -50,7 +50,7 @@ static void __attribute__((__format__(__printf__, 2, 0))) localtime_r (&t, &tm); if ( ! this->lines[this->cur] ) - this->lines[this->cur] = xine_xmalloc(SCRATCH_LINE_LEN_MAX+1); + this->lines[this->cur] = malloc(SCRATCH_LINE_LEN_MAX+1); if ( ! this->lines[this->cur] ) return; @@ -106,7 +106,7 @@ static void scratch_dispose (scratch_buffer_t *this) { scratch_buffer_t *_x_new_scratch_buffer (int num_lines) { scratch_buffer_t *this; - this = xine_xmalloc (sizeof (scratch_buffer_t)); + this = calloc(1, sizeof(scratch_buffer_t)); this->lines = calloc ((num_lines + 1), sizeof(char*)); this->ordered = calloc ((num_lines + 1), sizeof(char*)); diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c index a8464ac40..98e2b800e 100644 --- a/src/xine-engine/video_out.c +++ b/src/xine-engine/video_out.c @@ -143,7 +143,7 @@ static img_buf_fifo_t *vo_new_img_buf_queue () { img_buf_fifo_t *queue; - queue = (img_buf_fifo_t *) xine_xmalloc (sizeof (img_buf_fifo_t)); + queue = (img_buf_fifo_t *) calloc(1, sizeof(img_buf_fifo_t)); if( queue ) { queue->first = NULL; queue->last = NULL; @@ -1771,7 +1771,7 @@ xine_video_port_t *_x_vo_new_port (xine_t *xine, vo_driver_t *driver, int grabon int num_frame_buffers; - this = xine_xmalloc (sizeof (vos_t)) ; + this = calloc(1, sizeof(vos_t)) ; this->xine = xine; this->clock = xine->clock; diff --git a/src/xine-engine/video_overlay.c b/src/xine-engine/video_overlay.c index c189fa56b..945df3cb9 100644 --- a/src/xine-engine/video_overlay.c +++ b/src/xine-engine/video_overlay.c @@ -199,7 +199,7 @@ static void video_overlay_reset (video_overlay_t *this) { pthread_mutex_lock (&this->events_mutex); for (i=0; i < MAX_EVENTS; i++) { if (this->events[i].event == NULL) { - this->events[i].event = xine_xmalloc (sizeof(video_overlay_event_t)); + this->events[i].event = calloc(1, sizeof(video_overlay_event_t)); #ifdef LOG_DEBUG printf ("video_overlay: MALLOC2: this->events[%d].event %p, len=%d\n", i, @@ -293,7 +293,7 @@ static int32_t video_overlay_add_event(video_overlay_manager_t *this_gen, void event->object.overlay->hili_trans[i] = OVL_MAX_OPACITY; } - this->events[new_event].event->object.overlay = xine_xmalloc (sizeof(vo_overlay_t)); + this->events[new_event].event->object.overlay = calloc(1, sizeof(vo_overlay_t)); xine_fast_memcpy(this->events[new_event].event->object.overlay, event->object.overlay, sizeof(vo_overlay_t)); @@ -587,7 +587,7 @@ video_overlay_manager_t *_x_video_overlay_new_manager (xine_t *xine) { video_overlay_t *this; - this = (video_overlay_t *) xine_xmalloc (sizeof (video_overlay_t)); + this = (video_overlay_t *) calloc(1, sizeof(video_overlay_t)); this->xine = xine; this->video_overlay.init = video_overlay_init; diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 9cd5e8d5b..c22391642 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -307,7 +307,7 @@ static void ticket_dispose(xine_ticket_t *this) { static xine_ticket_t *ticket_init(void) { xine_ticket_t *port_ticket; - port_ticket = (xine_ticket_t *) xine_xmalloc(sizeof(xine_ticket_t)); + port_ticket = calloc(1, sizeof(xine_ticket_t)); port_ticket->acquire_nonblocking = ticket_acquire_nonblocking; port_ticket->acquire = ticket_acquire; @@ -570,7 +570,7 @@ xine_stream_t *xine_stream_new (xine_t *this, pthread_mutex_lock (&this->streams_lock); - stream = (xine_stream_t *) xine_xmalloc (sizeof (xine_stream_t)) ; + stream = (xine_stream_t *) calloc (1, sizeof (xine_stream_t)) ; stream->current_extra_info = malloc( sizeof( extra_info_t ) ); stream->audio_decoder_extra_info = malloc( sizeof( extra_info_t ) ); stream->video_decoder_extra_info = malloc( sizeof( extra_info_t ) ); @@ -1545,7 +1545,7 @@ xine_t *xine_new (void) { int i_err; #endif - this = xine_xmalloc (sizeof (xine_t)); + this = calloc(1, sizeof (xine_t)); if (!this) _x_abort(); diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c index 50d8796e8..597608883 100644 --- a/src/xine-engine/xine_interface.c +++ b/src/xine-engine/xine_interface.c @@ -990,7 +990,7 @@ int _x_message(xine_stream_t *stream, int type, ...) { args[n] = NULL; size += sizeof(xine_ui_message_data_t) + 1; - data = xine_xmalloc( size ); + data = calloc(1, size ); strcpy(data->compatibility.str, "Upgrade your frontend to see the error messages"); data->type = type; diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c index 768b41da4..48ceef688 100644 --- a/src/xine-utils/utils.c +++ b/src/xine-utils/utils.c @@ -257,7 +257,7 @@ void *xine_xmalloc_aligned(size_t alignment, size_t size, void **base) { char *ptr; - *base = ptr = xine_xmalloc (size+alignment); + *base = ptr = calloc(1, size+alignment); while ((size_t) ptr % alignment) ptr++; diff --git a/src/xine-utils/xine_buffer.c b/src/xine-utils/xine_buffer.c index 190ab5197..097ca0f1f 100644 --- a/src/xine-utils/xine_buffer.c +++ b/src/xine-utils/xine_buffer.c @@ -117,7 +117,7 @@ typedef struct { */ void *xine_buffer_init(int chunk_size) { - uint8_t *data=xine_xmalloc(chunk_size+XINE_BUFFER_HEADER_SIZE); + uint8_t *data=calloc(1, chunk_size+XINE_BUFFER_HEADER_SIZE); xine_buffer_header_t *header=(xine_buffer_header_t*)data; header->size=chunk_size; @@ -162,7 +162,7 @@ void *xine_buffer_dup(const void *buf) { CHECK_MAGIC(buf); #endif -new=xine_xmalloc(GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE); + new = malloc(GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE); xine_fast_memcpy(new, ((uint8_t*)buf)-XINE_BUFFER_HEADER_SIZE, GET_HEADER(buf)->size+XINE_BUFFER_HEADER_SIZE); diff --git a/src/xine-utils/xine_check.h b/src/xine-utils/xine_check.h deleted file mode 100644 index 4b21bf74e..000000000 --- a/src/xine-utils/xine_check.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef XINE_CHECK_H -#define XINE_CHECK_H -#include <stdio.h> - -#ifdef XINE_COMPILE -# include "xine.h" -#else -# include <xine.h> -#endif - -/* - * Start checking xine setup here - * - * cdrom_dev = Name of the device link for the cdrom drive (e.g. /dev/cdrom) - * dvd_dev = Name of the device link for the dvd drive (e.g. /dev/dvd) - */ - -/* Get Kernel information */ -xine_health_check_t* _x_health_check_kernel(xine_health_check_t*); - -/* health_check MTRR */ -xine_health_check_t* _x_health_check_mtrr(xine_health_check_t*); - -/* health_check CDROM */ -xine_health_check_t* _x_health_check_cdrom(xine_health_check_t*); - -/* health_check DVDROM */ -xine_health_check_t* _x_health_check_dvdrom(xine_health_check_t*); - -/* health_check DMA settings of DVD drive*/ -xine_health_check_t* _x_health_check_dma(xine_health_check_t*); - -/* health_check X */ -xine_health_check_t* _x_health_check_x(xine_health_check_t*); - -/* health_check Xv extension */ -xine_health_check_t* _x_health_check_xv(xine_health_check_t*); - -#endif diff --git a/src/xine-utils/xmlparser.c b/src/xine-utils/xmlparser.c index 14ce35c54..426643708 100644 --- a/src/xine-utils/xmlparser.c +++ b/src/xine-utils/xmlparser.c @@ -36,7 +36,6 @@ #include "xineutils.h" #else #define lprintf(...) -#define xine_xmalloc malloc #endif #include "xmllexer.h" #include "xmlparser.h" @@ -476,9 +475,9 @@ static int xml_parser_get_node (xml_node_t *current_node, char *root_name, int r int token_buffer_size = TOKEN_SIZE; int pname_buffer_size = TOKEN_SIZE; int nname_buffer_size = TOKEN_SIZE; - char *token_buffer = xine_xmalloc (token_buffer_size); - char *pname_buffer = xine_xmalloc (pname_buffer_size); - char *nname_buffer = xine_xmalloc (nname_buffer_size); + char *token_buffer = calloc(1, token_buffer_size); + char *pname_buffer = calloc(1, pname_buffer_size); + char *nname_buffer = calloc(1, nname_buffer_size); res = _xml_parser_get_node(&token_buffer, &token_buffer_size, &pname_buffer, &pname_buffer_size, @@ -590,7 +589,7 @@ static int xml_escape_string_internal (char *buf, const char *s, char *xml_escape_string (const char *s, xml_escape_quote_t quote_type) { - char *buf = xine_xmalloc (xml_escape_string_internal (NULL, s, quote_type)); + char *buf = calloc (1, xml_escape_string_internal (NULL, s, quote_type)); return buf ? (xml_escape_string_internal (buf, s, quote_type), buf) : NULL; } |