summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-12-07 15:34:29 +0000
committerDaniel Caujolle-Bert <f1rmb@users.sourceforge.net>2003-12-07 15:34:29 +0000
commitc8fdff20285b59cd892297317572fbb4c3633f78 (patch)
tree102be6141b635eb2bff16358ca13b79924b211f4
parenta2dcf860b2777e530646abd00202c3fb5b3a5a81 (diff)
downloadxine-lib-c8fdff20285b59cd892297317572fbb4c3633f78.tar.gz
xine-lib-c8fdff20285b59cd892297317572fbb4c3633f78.tar.bz2
get rid of XINE_{ASSERT,ABORT} and useless xine_print_trace (useless). Replace XINE_ASSERT by _x_assert, which works exaclty as assert, except that it still warns with NDEBUG defined (but don't abort). Fix missuning of assert(0), which isn't safe, abort is abort, assert is for debugging purpose only, so all assert(0) has been converted to abort() alls. In osd_preload_fonts(): alloc needed memory chunk. Define NDEBUG in CFLAGS, for non DEBUG build only.
CVS patchset: 5860 CVS date: 2003/12/07 15:34:29
-rw-r--r--configure.ac2
-rw-r--r--src/audio_out/audio_alsa_out.c10
-rw-r--r--src/dxr3/dxr3_decode_spu.c11
-rw-r--r--src/dxr3/dxr3_spu_encoder.c6
-rw-r--r--src/input/input_dvd.c12
-rw-r--r--src/input/input_plugin.h12
-rw-r--r--src/input/libdvdnav/decoder.c8
-rw-r--r--src/input/libdvdnav/nav_read.c7
-rw-r--r--src/input/libdvdnav/vm.c68
-rw-r--r--src/libdts/decoder.c10
-rw-r--r--src/libdts/print_info.c8
-rwxr-xr-xsrc/libmad/layer3.c7
-rwxr-xr-xsrc/libmad/timer.c6
-rw-r--r--src/libmpeg2new/libmpeg2/header.c2
-rw-r--r--src/libmpeg2new/xine_decoder.c30
-rw-r--r--src/libspudec/xine_decoder.c11
-rw-r--r--src/libxineadec/gsm610/long_term.c54
-rw-r--r--src/libxineadec/gsm610/lpc.c22
-rw-r--r--src/libxineadec/gsm610/rpe.c30
-rw-r--r--src/libxineadec/gsm610/short_term.c4
-rw-r--r--src/video_out/alphablend.c3
-rw-r--r--src/video_out/video_out_directfb.c6
-rw-r--r--src/video_out/video_out_opengl.c10
-rw-r--r--src/video_out/yuv2rgb_mlib.c9
-rw-r--r--src/xine-engine/audio_out.c10
-rw-r--r--src/xine-engine/buffer.c4
-rw-r--r--src/xine-engine/configfile.c20
-rw-r--r--src/xine-engine/lrb.c4
-rw-r--r--src/xine-engine/osd.c23
-rw-r--r--src/xine-engine/vo_scale.c4
-rw-r--r--src/xine-engine/xine_interface.c8
-rw-r--r--src/xine-utils/utils.c28
-rw-r--r--src/xine-utils/xineutils.h74
33 files changed, 239 insertions, 284 deletions
diff --git a/configure.ac b/configure.ac
index 92483a55d..2dc71791f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1344,7 +1344,7 @@ dnl (the alignment test macro does not like variables in the CFLAGS)
AC_C_ATTRIBUTE_ALIGNED
dnl Common cflags for all platforms
-CFLAGS="$wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $CFLAGS"
+CFLAGS="$wall -DNDEBUG -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE \$(MULTIPASS_CFLAGS) $CFLAGS"
DEBUG_CFLAGS="$wall -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE $DEBUG_CFLAGS"
enable_w32dll="no"
diff --git a/src/audio_out/audio_alsa_out.c b/src/audio_out/audio_alsa_out.c
index 890a0e280..87ac533b9 100644
--- a/src/audio_out/audio_alsa_out.c
+++ b/src/audio_out/audio_alsa_out.c
@@ -26,7 +26,7 @@
* (c) 2001 James Courtier-Dutton <James@superbug.demon.co.uk>
*
*
- * $Id: audio_alsa_out.c,v 1.119 2003/12/05 15:54:56 f1rmb Exp $
+ * $Id: audio_alsa_out.c,v 1.120 2003/12/07 15:34:29 f1rmb Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -720,7 +720,9 @@ static int ao_alsa_write(ao_driver_t *this_gen, int16_t *data, uint32_t count) {
#endif
if ((res = snd_pcm_prepare(this->audio_fd))<0) {
return 0;
- XINE_ASSERT (0,"audio_alsa_out: xrun: prepare error: %s", snd_strerror(res));
+ xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
+ "audio_alsa_out: xrun: prepare error: %s", snd_strerror(res));
+ abort();
}
state = snd_pcm_state(this->audio_fd);
#ifdef LOG_DEBUG
@@ -762,7 +764,9 @@ static int ao_alsa_write(ao_driver_t *this_gen, int16_t *data, uint32_t count) {
xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
"audio_alsa_out:write:BAD STATE2, state = %d, going to try XRUN\n",state);
if ((res = snd_pcm_prepare(this->audio_fd))<0) {
- XINE_ASSERT(0, "audio_alsa_out: xrun: prepare error: %s", snd_strerror(res));
+ xprintf(this->class->xine, XINE_VERBOSITY_DEBUG,
+ "audio_alsa_out: xrun: prepare error: %s", snd_strerror(res));
+ abort();
}
}
}
diff --git a/src/dxr3/dxr3_decode_spu.c b/src/dxr3/dxr3_decode_spu.c
index 27e696ecb..b75da4ccf 100644
--- a/src/dxr3/dxr3_decode_spu.c
+++ b/src/dxr3/dxr3_decode_spu.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dxr3_decode_spu.c,v 1.41 2003/12/05 15:54:57 f1rmb Exp $
+ * $Id: dxr3_decode_spu.c,v 1.42 2003/12/07 15:34:29 f1rmb Exp $
*/
/* dxr3 spu decoder plugin.
@@ -354,8 +354,10 @@ static void dxr3_spudec_decode_data(spu_decoder_t *this_gen, buf_element_t *buf)
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"dxr3_decode_spu: failed to set spu button (%s)\n", strerror(errno));
pthread_mutex_unlock(&this->dxr3_vo->spu_device_lock);
- } else
- XINE_ASSERT(0, "no working menu button found");
+ } else {
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "no working menu button found\n");
+ abort();
+ }
}
}
@@ -616,7 +618,8 @@ static int dxr3_spudec_copy_nav_to_btn(dxr3_spudec_t *this, int32_t mode, em8300
if (!button_ptr && this->pci.hli.hl_gi.btngr_ns >= 3 && (this->pci.hli.hl_gi.btngr3_dsp_ty & 2))
button_ptr = &this->pci.hli.btnit[2 * btns_per_group + this->buttonN - 1];
- XINE_ASSERT(button_ptr, "No suitable letterbox button group found.");
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "No suitable letterbox button group found.\n");
+ _x_assert(button_ptr);
} else {
unsigned int btns_per_group = 36 / this->pci.hli.hl_gi.btngr_ns;
diff --git a/src/dxr3/dxr3_spu_encoder.c b/src/dxr3/dxr3_spu_encoder.c
index 7b662efbe..c145f134f 100644
--- a/src/dxr3/dxr3_spu_encoder.c
+++ b/src/dxr3/dxr3_spu_encoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dxr3_spu_encoder.c,v 1.3 2003/12/05 15:54:58 f1rmb Exp $
+ * $Id: dxr3_spu_encoder.c,v 1.4 2003/12/07 15:34:29 f1rmb Exp $
*/
#include <stdio.h>
@@ -382,7 +382,7 @@ static void convert_overlay(spu_encoder_t *this)
}
/* we should be byte aligned here */
- XINE_ASSERT(higher_nibble, "bad state during spu encoding");
+ _x_assert(higher_nibble);
/* control sequence starts here */
this->target[2] = offset >> 8;
@@ -467,7 +467,7 @@ static void write_rle(spu_encoder_t *this, int *offset, int *higher_nibble, int
write_nibble(this, offset, higher_nibble, (length & 0xc) | color);
return;
}
- XINE_ASSERT(0, "bad state during spu encoding");
+ abort();
}
static void write_byte(spu_encoder_t *this, int *offset, uint8_t byte)
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 4003021d8..d8726a98b 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.175 2003/12/05 15:54:58 f1rmb Exp $
+ * $Id: input_dvd.c,v 1.176 2003/12/07 15:34:30 f1rmb Exp $
*
*/
@@ -1509,9 +1509,8 @@ static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_st
return NULL;
this = (dvd_input_plugin_t *) xine_xmalloc (sizeof (dvd_input_plugin_t));
- if (this == NULL) {
- XINE_ASSERT(0, "input_dvd.c: xine_xmalloc failed!!!! You have run out of memory\n");
- }
+ if (!this)
+ return NULL;
this->input_plugin.open = dvd_plugin_open;
this->input_plugin.get_capabilities = dvd_plugin_get_capabilities;
@@ -1629,6 +1628,8 @@ static void *init_class (xine_t *xine, void *data) {
#endif
this = (dvd_input_class_t *) xine_xmalloc (sizeof (dvd_input_class_t));
+ if (!this)
+ return NULL;
this->input_class.get_instance = dvd_class_get_instance;
this->input_class.get_identifier = dvd_class_get_identifier;
@@ -1727,6 +1728,9 @@ static void *init_class (xine_t *xine, void *data) {
/*
* $Log: input_dvd.c,v $
+ * Revision 1.176 2003/12/07 15:34:30 f1rmb
+ * get rid of XINE_{ASSERT,ABORT} and useless xine_print_trace (useless). Replace XINE_ASSERT by _x_assert, which works exaclty as assert, except that it still warns with NDEBUG defined (but don't abort). Fix missuning of assert(0), which isn't safe, abort is abort, assert is for debugging purpose only, so all assert(0) has been converted to abort() alls. In osd_preload_fonts(): alloc needed memory chunk. Define NDEBUG in CFLAGS, for non DEBUG build only.
+ *
* Revision 1.175 2003/12/05 15:54:58 f1rmb
* cleanup phase II. use xprintf when it's relevant, use xine_xmalloc when it's relevant too. Small other little fix (can't remember). Change few internal function prototype because it xine_t pointer need to be used if some xine's internal sections. NOTE: libdvd{nav,read} is still too noisy, i will take a look to made it quit, without invasive changes. To be continued...
*
diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h
index f578bcb99..9181f46c5 100644
--- a/src/input/input_plugin.h
+++ b/src/input/input_plugin.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_plugin.h,v 1.53 2003/11/23 23:20:57 valtri Exp $
+ * $Id: input_plugin.h,v 1.54 2003/12/07 15:34:30 f1rmb Exp $
*/
#ifndef HAVE_INPUT_PLUGIN_H
@@ -328,8 +328,8 @@ struct input_plugin_s {
* Duplicate two mrls entries (s = source, d = destination).
*/
#define MRL_DUPLICATE(s, d) { \
- XINE_ASSERT((s) != NULL, "value 's' is NULL"); \
- XINE_ASSERT((d) != NULL, "value 'd' is NULL"); \
+ _x_assert((s) != NULL); \
+ _x_assert((d) != NULL); \
\
if((s)->origin) { \
if((d)->origin) { \
@@ -374,11 +374,11 @@ struct input_plugin_s {
#define MRLS_DUPLICATE(s, d) { \
int i = 0; \
\
- XINE_ASSERT((s) != NULL, "value 's' is NULL"); \
- XINE_ASSERT((d) != NULL, "value 'd' is NULL"); \
+ _x_assert((s) != NULL); \
+ _x_assert((d) != NULL); \
\
while((s) != NULL) { \
- d[i] = (xine_mrl_t *) malloc(sizeof(xine_mrl_t)); \
+ d[i] = (xine_mrl_t *) malloc(sizeof(xine_mrl_t)); \
MRL_DUPLICATE(s[i], d[i]); \
i++; \
} \
diff --git a/src/input/libdvdnav/decoder.c b/src/input/libdvdnav/decoder.c
index 44b3b24e2..187ee5f65 100644
--- a/src/input/libdvdnav/decoder.c
+++ b/src/input/libdvdnav/decoder.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: decoder.c,v 1.12 2003/08/25 21:51:40 f1rmb Exp $
+ * $Id: decoder.c,v 1.13 2003/12/07 15:34:30 f1rmb Exp $
*
*/
@@ -49,7 +49,7 @@ uint32_t vm_getbits(command_t *command, int32_t start, int32_t count) {
(count < 0) ||
(start < 0) ) {
fprintf(MSG_OUT, "libdvdnav: Bad call to vm_getbits. Parameter out of range\n");
- assert(0);
+ abort();
}
/* all ones, please */
bit_mask = ~bit_mask;
@@ -512,7 +512,7 @@ static int32_t eval_command(uint8_t *bytes, registers_t* registers, link_t *retu
res = eval_special_instruction(&command, cond);
if(res == -1) {
fprintf(MSG_OUT, "libdvdnav: Unknown Instruction!\n");
- assert(0);
+ abort();
}
break;
case 1: /* Link/jump instructions */
@@ -566,7 +566,7 @@ static int32_t eval_command(uint8_t *bytes, registers_t* registers, link_t *retu
break;
default: /* Unknown command */
fprintf(MSG_OUT, "libdvdnav: WARNING: Unknown Command=%x\n", vm_getbits(&command, 63, 3));
- assert(0);
+ abort();
}
/* Check if there are bits not yet examined */
diff --git a/src/input/libdvdnav/nav_read.c b/src/input/libdvdnav/nav_read.c
index e4114034a..c76aa55a8 100644
--- a/src/input/libdvdnav/nav_read.c
+++ b/src/input/libdvdnav/nav_read.c
@@ -19,6 +19,7 @@
#include "config.h"
#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
#include <inttypes.h>
#include <assert.h>
@@ -51,7 +52,7 @@ static uint32_t getbits(getbits_state_t *state, uint32_t number_of_bits) {
uint8_t byte=0;
if (number_of_bits > 32) {
printf("Number of bits > 32 in getbits\n");
- assert(0);
+ abort();
}
if ((state->bit_position) > 0) { /* Last getbits left us in the middle of a byte. */
@@ -123,7 +124,7 @@ static uint32_t get32bits(getbits_state_t *state) {
void navRead_PCI(pci_t *pci, unsigned char *buffer) {
int32_t i, j;
getbits_state_t state;
- if (getbits_init(&state, buffer)) assert(0); /* Passed NULL pointers */
+ if (getbits_init(&state, buffer)) abort(); /* Passed NULL pointers */
/* pci pci_gi */
pci->pci_gi.nv_pck_lbn = getbits(&state, 32 );
@@ -291,7 +292,7 @@ void navRead_PCI(pci_t *pci, unsigned char *buffer) {
void navRead_DSI(dsi_t *dsi, unsigned char *buffer) {
int i;
getbits_state_t state;
- if (getbits_init(&state, buffer)) assert(0); /* Passed NULL pointers */
+ if (getbits_init(&state, buffer)) abort(); /* Passed NULL pointers */
/* dsi dsi gi */
dsi->dsi_gi.nv_pck_scr = getbits(&state, 32 );
diff --git a/src/input/libdvdnav/vm.c b/src/input/libdvdnav/vm.c
index 9622254c4..334e94523 100644
--- a/src/input/libdvdnav/vm.c
+++ b/src/input/libdvdnav/vm.c
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: vm.c,v 1.24 2003/08/03 09:44:16 mroi Exp $
+ * $Id: vm.c,v 1.25 2003/12/07 15:34:30 f1rmb Exp $
*
*/
@@ -201,27 +201,27 @@ static void ifoOpenNewVTSI(vm_t *vm, dvd_reader_t *dvd, int vtsN) {
vm->vtsi = ifoOpenVTSI(dvd, vtsN);
if(vm->vtsi == NULL) {
fprintf(MSG_OUT, "libdvdnav: ifoOpenVTSI failed - CRASHING!!!\n");
- assert(0);
+ abort();
}
if(!ifoRead_VTS_PTT_SRPT(vm->vtsi)) {
fprintf(MSG_OUT, "libdvdnav: ifoRead_VTS_PTT_SRPT failed - CRASHING!!!\n");
- assert(0);
+ abort();
}
if(!ifoRead_PGCIT(vm->vtsi)) {
fprintf(MSG_OUT, "libdvdnav: ifoRead_PGCIT failed - CRASHING!!!\n");
- assert(0);
+ abort();
}
if(!ifoRead_PGCI_UT(vm->vtsi)) {
fprintf(MSG_OUT, "libdvdnav: ifoRead_PGCI_UT failed - CRASHING!!!\n");
- assert(0);
+ abort();
}
if(!ifoRead_VOBU_ADMAP(vm->vtsi)) {
fprintf(MSG_OUT, "libdvdnav: ifoRead_VOBU_ADMAP vtsi failed - CRASHING\n");
- assert(0);
+ abort();
}
if(!ifoRead_TITLE_VOBU_ADMAP(vm->vtsi)) {
fprintf(MSG_OUT, "libdvdnav: ifoRead_TITLE_VOBU_ADMAP vtsi failed - CRASHING\n");
- assert(0);
+ abort();
}
(vm->state).vtsN = vtsN;
}
@@ -392,7 +392,7 @@ vm_t *vm_new_copy(vm_t *source) {
/* restore pgc pointer into the new vtsi */
if (!set_PGCN(target, pgcN))
- assert(0);
+ abort();
(target->state).pgN = pgN;
}
@@ -867,7 +867,7 @@ video_attr_t vm_get_video_attr(vm_t *vm) {
case FP_DOMAIN:
return vm->vmgi->vmgi_mat->vmgm_video_attr;
}
- assert(0);
+ abort();
}
audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN) {
@@ -880,7 +880,7 @@ audio_attr_t vm_get_audio_attr(vm_t *vm, int streamN) {
case FP_DOMAIN:
return vm->vmgi->vmgi_mat->vmgm_audio_attr;
}
- assert(0);
+ abort();
}
subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN) {
@@ -893,7 +893,7 @@ subp_attr_t vm_get_subp_attr(vm_t *vm, int streamN) {
case FP_DOMAIN:
return vm->vmgi->vmgi_mat->vmgm_subp_attr;
}
- assert(0);
+ abort();
}
@@ -1057,7 +1057,7 @@ static link_t play_Cell(vm_t *vm) {
case 1: /* The first cell in the block */
switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type) {
case 0: /* Not part of a block */
- assert(0);
+ abort();
case 1: /* Angle block */
/* Loop and check each cell instead? So we don't get outside the block? */
(vm->state).cellN += (vm->state).AGL_REG - 1;
@@ -1080,7 +1080,7 @@ static link_t play_Cell(vm_t *vm) {
fprintf(MSG_OUT, "libdvdnav: Invalid? Cell block_mode (%d), block_type (%d)\n",
(vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode,
(vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type);
- assert(0);
+ abort();
}
break;
case 2: /* Cell in the block */
@@ -1093,7 +1093,7 @@ static link_t play_Cell(vm_t *vm) {
/* Updates (vm->state).pgN and PTTN_REG */
if(!set_PGN(vm)) {
/* Should not happen */
- assert(0);
+ abort();
return play_PGC_post(vm);
}
(vm->state).cell_restart++;
@@ -1161,7 +1161,7 @@ static link_t play_Cell_post(vm_t *vm) {
default:
switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type) {
case 0: /* Not part of a block */
- assert(0);
+ abort();
case 1: /* Angle block */
/* Skip the 'other' angles */
(vm->state).cellN++;
@@ -1176,7 +1176,7 @@ static link_t play_Cell_post(vm_t *vm) {
fprintf(MSG_OUT, "libdvdnav: Invalid? Cell block_mode (%d), block_type (%d)\n",
(vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode,
(vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_type);
- assert(0);
+ abort();
}
break;
}
@@ -1278,7 +1278,7 @@ static int process_command(vm_t *vm, link_t link_values) {
(vm->state).HL_BTNN_REG = link_values.data1 << 10;
assert((vm->state).pgc->next_pgc_nr != 0);
if(!set_PGCN(vm, (vm->state).pgc->next_pgc_nr))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case LinkPrevPGC:
@@ -1288,7 +1288,7 @@ static int process_command(vm_t *vm, link_t link_values) {
(vm->state).HL_BTNN_REG = link_values.data1 << 10;
assert((vm->state).pgc->prev_pgc_nr != 0);
if(!set_PGCN(vm, (vm->state).pgc->prev_pgc_nr))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case LinkGoUpPGC:
@@ -1298,7 +1298,7 @@ static int process_command(vm_t *vm, link_t link_values) {
(vm->state).HL_BTNN_REG = link_values.data1 << 10;
assert((vm->state).pgc->goup_pgc_nr != 0);
if(!set_PGCN(vm, (vm->state).pgc->goup_pgc_nr))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case LinkTailPGC:
@@ -1346,7 +1346,7 @@ static int process_command(vm_t *vm, link_t link_values) {
link_values.data1 = (vm->state).rsm_blockN;
if(!set_PGN(vm)) {
/* Were at the end of the PGC, should not happen for a RSM */
- assert(0);
+ abort();
link_values.command = LinkTailPGC;
link_values.data1 = 0; /* No button */
}
@@ -1356,7 +1356,7 @@ static int process_command(vm_t *vm, link_t link_values) {
case LinkPGCN:
/* Link to Program Chain Number:data1 */
if(!set_PGCN(vm, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case LinkPTTN:
@@ -1367,7 +1367,7 @@ static int process_command(vm_t *vm, link_t link_values) {
if(link_values.data2 != 0)
(vm->state).HL_BTNN_REG = link_values.data2 << 10;
if(!set_VTS_PTT(vm, (vm->state).vtsN, (vm->state).VTS_TTN_REG, link_values.data1))
- assert(0);
+ abort();
link_values = play_PG(vm);
break;
case LinkPGN:
@@ -1401,7 +1401,7 @@ static int process_command(vm_t *vm, link_t link_values) {
/* Set SPRM1 and SPRM2 */
assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == FP_DOMAIN); /* ?? */
if(!set_TT(vm, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case JumpVTS_TT:
@@ -1412,7 +1412,7 @@ static int process_command(vm_t *vm, link_t link_values) {
/* Set SPRM1 and SPRM2 */
assert((vm->state).domain == VTSM_DOMAIN || (vm->state).domain == VTS_DOMAIN); /* ?? */
if(!set_VTS_TT(vm, (vm->state).vtsN, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case JumpVTS_PTT:
@@ -1423,7 +1423,7 @@ static int process_command(vm_t *vm, link_t link_values) {
/* Set SPRM1 and SPRM2 */
assert((vm->state).domain == VTSM_DOMAIN || (vm->state).domain == VTS_DOMAIN); /* ?? */
if(!set_VTS_PTT(vm, (vm->state).vtsN, link_values.data1, link_values.data2))
- assert(0);
+ abort();
link_values = play_PGC_PG(vm, (vm->state).pgN);
break;
@@ -1434,7 +1434,7 @@ static int process_command(vm_t *vm, link_t link_values) {
/* Stop SPRM9 Timer and any GPRM counters */
assert((vm->state).domain == VMGM_DOMAIN || (vm->state).domain == VTSM_DOMAIN); /* ?? */
if (!set_FP_PGC(vm))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case JumpSS_VMGM_MENU:
@@ -1444,7 +1444,7 @@ static int process_command(vm_t *vm, link_t link_values) {
assert((vm->state).domain != VTS_DOMAIN); /* ?? */
(vm->state).domain = VMGM_DOMAIN;
if(!set_MENU(vm, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case JumpSS_VTSM:
@@ -1478,7 +1478,7 @@ static int process_command(vm_t *vm, link_t link_values) {
/* assert(link_values.data2 == 1); */
(vm->state).VTS_TTN_REG = link_values.data2;
if(!set_MENU(vm, link_values.data3))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case JumpSS_VMGM_PGC:
@@ -1487,7 +1487,7 @@ static int process_command(vm_t *vm, link_t link_values) {
assert((vm->state).domain != VTS_DOMAIN); /* ?? */
(vm->state).domain = VMGM_DOMAIN;
if(!set_PGCN(vm, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
@@ -1507,7 +1507,7 @@ static int process_command(vm_t *vm, link_t link_values) {
set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0);
(vm->state).domain = VMGM_DOMAIN;
if(!set_MENU(vm, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case CallSS_VTSM:
@@ -1518,7 +1518,7 @@ static int process_command(vm_t *vm, link_t link_values) {
set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0);
(vm->state).domain = VTSM_DOMAIN;
if(!set_MENU(vm, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case CallSS_VMGM_PGC:
@@ -1529,12 +1529,12 @@ static int process_command(vm_t *vm, link_t link_values) {
set_RSMinfo(vm, link_values.data2, /* We dont have block info */ 0);
(vm->state).domain = VMGM_DOMAIN;
if(!set_PGCN(vm, link_values.data1))
- assert(0);
+ abort();
link_values = play_PGC(vm);
break;
case PlayThis:
/* Should never happen. */
- assert(0);
+ abort();
break;
}
@@ -1818,7 +1818,7 @@ static pgcit_t* get_PGCIT(vm_t *vm) {
pgcit = NULL; /* Should never hapen */
fprintf(MSG_OUT, "libdvdnav: get_PGCIT: Unknown domain:%d\n",
(vm->state).domain);
- assert(0);
+ abort();
break;
}
diff --git a/src/libdts/decoder.c b/src/libdts/decoder.c
index 724d61927..6023366b4 100644
--- a/src/libdts/decoder.c
+++ b/src/libdts/decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: decoder.c,v 1.1 2003/08/05 11:30:56 jcdutton Exp $
+ * $Id: decoder.c,v 1.2 2003/12/07 15:34:30 f1rmb Exp $
*
* 04-08-2003 DTS software decode (C) James Courtier-Dutton
*
@@ -80,7 +80,7 @@ static uint32_t getbits(getbits_state_t *state, uint32_t number_of_bits) {
uint8_t byte=0;
if (number_of_bits > 32) {
printf("Number of bits > 32 in getbits\n");
- assert(0);
+ abort();
}
if ((state->bit_position) > 0) { /* Last getbits left us in the middle of a byte. */
@@ -447,7 +447,8 @@ void dts_parse_data (dts_decoder_t *this, buf_element_t *buf) {
if (decoder_data.nQSelect == 6) {
decoder_data.bit_allocation_index[ch][n] = getbits(&state,5);
} else {
- XINE_ASSERT(0, "bit_alloc parse failed, (nQSelect != 6) not implemented yet.");
+ printf("bit_alloc parse failed, (nQSelect != 6) not implemented yet.");
+ abort();
}
/*QABITS.ppQ[nQSelect]->InverseQ(&state, bit_allocation_index[ch][n]); */
@@ -476,7 +477,8 @@ void dts_parse_data (dts_decoder_t *this, buf_element_t *buf) {
if (decoder_data.nQSelect == 0) {
decoder_data.transition_mode[ch][n] = huff_lookup(&state, HuffA4);
} else {
- XINE_ASSERT(0, "transition mod parse failed, (nQSelect != 0) not implemented yet.");
+ printf("transition mod parse failed, (nQSelect != 0) not implemented yet.");
+ abort();
}
/* QTMODE.ppQ[nQSelect]->InverseQ(&state,transition_mode[ch][n]); */
diff --git a/src/libdts/print_info.c b/src/libdts/print_info.c
index d6d45d86d..50bd75098 100644
--- a/src/libdts/print_info.c
+++ b/src/libdts/print_info.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: print_info.c,v 1.1 2003/08/05 11:30:56 jcdutton Exp $
+ * $Id: print_info.c,v 1.2 2003/12/07 15:34:30 f1rmb Exp $
*
* 04-08-2003 DTS software decode (C) James Courtier-Dutton
*
@@ -213,9 +213,9 @@ void dts_print_decoded_data(decoder_data_t *decoder_data) {
#endif
-XINE_ASSERT(0, "Parse exited as required!");
+ printf("Parse exited as required!");
+ abort();
-return;
+ return;
}
#endif
-
diff --git a/src/libmad/layer3.c b/src/libmad/layer3.c
index d4db46ffc..5e3214b39 100755
--- a/src/libmad/layer3.c
+++ b/src/libmad/layer3.c
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: layer3.c,v 1.4 2003/02/28 02:51:49 storri Exp $
+ * $Id: layer3.c,v 1.5 2003/12/07 15:34:30 f1rmb Exp $
*/
# ifdef HAVE_CONFIG_H
@@ -1247,7 +1247,7 @@ enum mad_error III_huffdecode(struct mad_bitptr *ptr, mad_fixed_t xr[576],
}
}
- XINE_ASSERT(-bits_left <= (MAD_BUFFER_GUARD * CHAR_BIT), "-bits_left > (MAD_BUFFER_GUARD * CHAR_BIT");
+ _x_assert(-bits_left <= (MAD_BUFFER_GUARD * CHAR_BIT));
# if 0 && defined(DEBUG)
if (bits_left < 0)
@@ -2430,8 +2430,7 @@ int mad_layer_III(struct mad_stream *stream, struct mad_frame *frame)
*stream->main_data + stream->md_len - si.main_data_begin);
if (md_len > si.main_data_begin) {
- XINE_ASSERT((stream->md_len + md_len -
- si.main_data_begin) <= MAD_BUFFER_MDLEN, "?");
+ _x_assert((stream->md_len + md_len - si.main_data_begin) <= MAD_BUFFER_MDLEN);
memcpy(*stream->main_data + stream->md_len,
mad_bit_nextbyte(&stream->ptr),
diff --git a/src/libmad/timer.c b/src/libmad/timer.c
index 47dbfca41..69a2efb40 100755
--- a/src/libmad/timer.c
+++ b/src/libmad/timer.c
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
- * $Id: timer.c,v 1.4 2003/02/28 02:51:50 storri Exp $
+ * $Id: timer.c,v 1.5 2003/12/07 15:34:30 f1rmb Exp $
*/
# ifdef HAVE_CONFIG_H
@@ -123,7 +123,7 @@ void reduce_rational(unsigned long *numer, unsigned long *denom)
factor = gcd(*numer, *denom);
- XINE_ASSERT(factor != 0, "value 'factor' is equal to 0. This will result in a divide by zero error.");
+ _x_assert(factor != 0);
*numer /= factor;
*denom /= factor;
@@ -140,7 +140,7 @@ unsigned long scale_rational(unsigned long numer, unsigned long denom,
reduce_rational(&numer, &denom);
reduce_rational(&scale, &denom);
- XINE_ASSERT(denom != 0, "value 'denom' is 0. This will result in a divide by zero error");
+ _x_assert(denom != 0);
if (denom < scale)
return numer * (scale / denom) + numer * (scale % denom) / denom;
diff --git a/src/libmpeg2new/libmpeg2/header.c b/src/libmpeg2new/libmpeg2/header.c
index c0910505f..894a86b30 100644
--- a/src/libmpeg2new/libmpeg2/header.c
+++ b/src/libmpeg2new/libmpeg2/header.c
@@ -480,7 +480,7 @@ int mpeg2_header_picture (mpeg2dec_t * mpeg2dec)
fbuf->buf[2] = fbuf->buf[1] + (size >> 2);
}
}
- assert(0);
+ abort();
mpeg2_set_fbuf (mpeg2dec, type);
}
} else {
diff --git a/src/libmpeg2new/xine_decoder.c b/src/libmpeg2new/xine_decoder.c
index 1f41f68b4..c30d1a967 100644
--- a/src/libmpeg2new/xine_decoder.c
+++ b/src/libmpeg2new/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.16 2003/12/05 15:54:59 f1rmb Exp $
+ * $Id: xine_decoder.c,v 1.17 2003/12/07 15:34:30 f1rmb Exp $
*
* stuff needed to turn libmpeg2 into a xine decoder plugin
*/
@@ -74,7 +74,7 @@ static void mpeg2_video_print_bad_state(uint32_t * img_state) {
m++;
}
}
- if (m > 3) assert(0);
+ if (m > 3) abort();
if (m == 0) printf("NO FRAMES\n");
}
@@ -206,7 +206,7 @@ static void mpeg2_video_decode_data (video_decoder_t *this_gen, buf_element_t *b
#endif
if (this->img_state[img->id] != 0) {
printf ("libmpeg2:decode_data:get_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
this->img_state[img->id] = 1;
@@ -235,7 +235,7 @@ static void mpeg2_video_decode_data (video_decoder_t *this_gen, buf_element_t *b
#endif
if (this->img_state[img->id] != 1) {
printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 1) {
frame_skipping = img->draw (img, this->stream);
@@ -246,7 +246,7 @@ static void mpeg2_video_decode_data (video_decoder_t *this_gen, buf_element_t *b
}
if (info->discard_fbuf && !info->discard_fbuf->id) {
printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
- assert(0);
+ abort();
}
if (info->discard_fbuf && info->discard_fbuf->id) {
img = (vo_frame_t *) info->discard_fbuf->id;
@@ -255,7 +255,7 @@ static void mpeg2_video_decode_data (video_decoder_t *this_gen, buf_element_t *b
#endif
if (this->img_state[img->id] != 2) {
printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 2) {
img->free(img);
@@ -308,7 +308,7 @@ static void mpeg2_video_reset (video_decoder_t *this_gen) {
if (this->img_state[img->id] != 1) {
printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 1) {
frame_skipping = img->draw (img, this->stream);
@@ -319,13 +319,13 @@ static void mpeg2_video_reset (video_decoder_t *this_gen) {
if (info->discard_fbuf && !info->discard_fbuf->id) {
printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
- assert(0);
+ abort();
}
if (info->discard_fbuf && info->discard_fbuf->id) {
img = (vo_frame_t *) info->discard_fbuf->id;
if (this->img_state[img->id] != 2) {
printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 2) {
img->free(img);
@@ -339,7 +339,7 @@ static void mpeg2_video_reset (video_decoder_t *this_gen) {
if (this->img_state[img->id] != 1) {
printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 1) {
frame_skipping = img->draw (img, this->stream);
@@ -350,13 +350,13 @@ static void mpeg2_video_reset (video_decoder_t *this_gen) {
if (info->discard_fbuf && !info->discard_fbuf->id) {
printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
- assert(0);
+ abort();
}
if (info->discard_fbuf && info->discard_fbuf->id) {
img = (vo_frame_t *) info->discard_fbuf->id;
if (this->img_state[img->id] != 2) {
printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 2) {
img->free(img);
@@ -370,7 +370,7 @@ static void mpeg2_video_reset (video_decoder_t *this_gen) {
if (this->img_state[img->id] != 1) {
printf ("libmpeg2:decode_data:draw_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 1) {
frame_skipping = img->draw (img, this->stream);
@@ -381,13 +381,13 @@ static void mpeg2_video_reset (video_decoder_t *this_gen) {
if (info->discard_fbuf && !info->discard_fbuf->id) {
printf ("libmpeg2:decode_data:BAD free_frame discard_fbuf=%p\n", info->discard_fbuf);
- assert(0);
+ abort();
}
if (info->discard_fbuf && info->discard_fbuf->id) {
img = (vo_frame_t *) info->discard_fbuf->id;
if (this->img_state[img->id] != 2) {
printf ("libmpeg2:decode_data:free_frame id=%d BAD STATE:%d\n", img->id, this->img_state[img->id]);
- assert(0);
+ abort();
}
if (this->img_state[img->id] == 2) {
img->free(img);
diff --git a/src/libspudec/xine_decoder.c b/src/libspudec/xine_decoder.c
index 09b4c5795..cfc07e5f2 100644
--- a/src/libspudec/xine_decoder.c
+++ b/src/libspudec/xine_decoder.c
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.102 2003/12/05 15:55:00 f1rmb Exp $
+ * $Id: xine_decoder.c,v 1.103 2003/12/07 15:34:30 f1rmb Exp $
*
* stuff needed to turn libspu into a xine decoder plugin
*/
@@ -236,8 +236,10 @@ static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t
printf ("libspudec:xine_decoder.c:spudec_event_listener:this=%p\n",this);
printf ("libspudec:xine_decoder.c:spudec_event_listener:this->menu_handle=%d\n",this->menu_handle);
#endif
- XINE_ASSERT(this->menu_handle >= 0, "Menu handle alloc failed. No more overlays objects available. Only 5 at once please.");
-
+ xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
+ "Menu handle alloc failed. No more overlays objects available. Only 5 at once please.");
+ _x_assert(this->menu_handle >= 0);
+
if (show > 0) {
#ifdef LOG_NAV
fprintf (stderr,"libspudec:xine_decoder.c:spudec_event_listener:buttonN = %u show=%d\n",
@@ -271,7 +273,8 @@ static void spudec_set_button (spu_decoder_t *this_gen, int32_t button, int32_t
} else {
xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG,
"libspudec:xine_decoder.c:spudec_event_listener:HIDE ????\n");
- XINE_ASSERT(0, "We dropped out here for some reason");
+ printf("We dropped out here for some reason");
+ abort();
overlay_event->object.handle = this->menu_handle;
overlay_event->event_type = OVERLAY_EVENT_HIDE;
}
diff --git a/src/libxineadec/gsm610/long_term.c b/src/libxineadec/gsm610/long_term.c
index c8564447d..625662e1f 100644
--- a/src/libxineadec/gsm610/long_term.c
+++ b/src/libxineadec/gsm610/long_term.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/long_term.c,v 1.2 2003/02/28 02:51:50 storri Exp $ */
+/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/long_term.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
#include <stdio.h>
#include "xineutils.h"
@@ -81,13 +81,13 @@ static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out),
temp = 0;
if (dmax == 0) scal = 0;
else {
- XINE_ASSERT(dmax > 0, "value 'dmax' is not > 0: %d", dmax);
+ _x_assert(dmax > 0);
temp = gsm_norm( (longword)dmax << 16 );
}
if (temp > 6) scal = 0;
else scal = 6 - temp;
- XINE_ASSERT(scal >= 0, "value 'scal' is not >= 0: %d", scal);
+ _x_assert(scal >= 0);
/* Search for the maximum cross-correlation and coding of the LTP lag
*/
@@ -107,10 +107,10 @@ static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out),
/* Rescaling of L_max
*/
- XINE_ASSERT((scal <= 100) && (scal >= -100), "value 'scal' is not within range -100 to 100: %d", scal);
+ _x_assert((scal <= 100) && (scal >= -100));
L_max = L_max >> (6 - scal); /* sub(6, scal) */
- XINE_ASSERT( Nc <= 120 && Nc >= 40, "value 'Nc' is not within range 40 to 120: %d", Nc);
+ _x_assert(Nc <= 120 && Nc >= 40);
/* Compute the power of the reconstructed short term residual
* signal dp[..]
@@ -182,14 +182,14 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
temp = 0;
if (dmax == 0) scal = 0;
else {
- XINE_ASSERT(dmax > 0, "value 'dmax' is not > 0: %d", dmax);
- temp = gsm_norm( (longword)dmax << 16 );
+ _x_assert(dmax > 0);
+ temp = gsm_norm( (longword)dmax << 16 );
}
if (temp > 6) scal = 0;
else scal = 6 - temp;
- XINE_ASSERT(scal >= 0, "value 'scal' is not >= 0: %d", scal);
+ _x_assert(scal >= 0);
/* Initialization of a working array wt
*/
@@ -242,10 +242,10 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
/* Rescaling of L_max
*/
- XINE_ASSERT( (scal <= 100) && (scal >= -100), "value 'scal' is not within range -100 to 100: %d", scal);
+ _x_assert( (scal <= 100) && (scal >= -100));
L_max = L_max >> (6 - scal); /* sub(6, scal) */
- XINE_ASSERT( Nc <= 120 && Nc >= 40, "value 'Nc' is not within range 40 to 120: %d", Nc);
+ _x_assert( Nc <= 120 && Nc >= 40);
/* Compute the power of the reconstructed short term residual
* signal dp[..]
@@ -323,7 +323,7 @@ static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out),
temp = 0;
if (dmax == 0) scal = 0;
else {
- XINE_ASSERT(dmax > 0, "value 'dmax' is not > 0: %d", dmax);
+ _x_assert(dmax > 0);
temp = gsm_norm( (longword)dmax << 16 );
}
@@ -331,7 +331,7 @@ static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out),
if (temp > 6) scal = 0;
else scal = 6 - temp;
- XINE_ASSERT(scal >= 0, "value 'scal' is not >= 0: %d", scal);
+ _x_assert(scal >= 0);
ltp_cut = (longword)SASR(dmax, scal) * st->ltp_cut / 100;
@@ -424,11 +424,11 @@ static void Cut_Calculation_of_the_LTP_parameters P5((st, d,dp,bc_out,Nc_out),
/* Rescaling of L_max
*/
- XINE_ASSERT( (scal <= 100) && (scal >= -100), "value 'scal' is not within range -100 to 100: %d", scal);
+ _x_assert( (scal <= 100) && (scal >= -100));
L_max = L_max >> (6 - scal); /* sub(6, scal) */
- XINE_ASSERT( Nc <= 120 && Nc >= 40, "value 'Nc' is not within range 40 to 120: %d", Nc);
+ _x_assert( Nc <= 120 && Nc >= 40);
/* Compute the power of the reconstructed short term residual
* signal dp[..]
@@ -502,14 +502,14 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
temp = 0;
if (dmax == 0) scal = 0;
else {
- XINE_ASSERT(dmax > 0, "value 'dmax' is not > 0: %d", dmax);
+ _x_assert(dmax > 0);
temp = gsm_norm( (longword)dmax << 16 );
}
if (temp > 6) scal = 0;
else scal = 6 - temp;
- XINE_ASSERT(scal >= 0, "value 'scal' is not >= 0: %d", scal);
+ _x_assert(scal >= 0);
/* Initialization of a working array wt
*/
@@ -591,11 +591,11 @@ static void Calculation_of_the_LTP_parameters P4((d,dp,bc_out,Nc_out),
/* Rescaling of L_max
*/
- XINE_ASSERT( (scal <= 100) && (scal >= -100), "value 'scal' is not within range -100 to 100: %d", scal);
+ _x_assert( (scal <= 100) && (scal >= -100));
L_max = L_max >> (6 - scal); /* sub(6, scal) */
- XINE_ASSERT( Nc <= 120 && Nc >= 40, "value 'Nc' is not within range 40 to 120: %d", Nc);
+ _x_assert( Nc <= 120 && Nc >= 40);
/* Compute the power of the reconstructed short term residual
@@ -666,7 +666,7 @@ static void Cut_Fast_Calculation_of_the_LTP_parameters P5((st,
else if (-d[k] > wt_max) wt_max = -d[best_k = k];
}
- XINE_ASSERT(wt_max >= 0, "value 'wt_max' is not >= 0: %d", wt_max);
+ _x_assert(wt_max >= 0);
wt_float = (float)wt_max;
for (k = -120; k < 0; ++k) dp_float[k] = (float)dp[k];
@@ -884,12 +884,12 @@ void Gsm_Long_Term_Predictor P7((S,d,dp,e,dpp,Nc,bc), /* 4x for 160 samples */
word * bc /* gain factor OUT */
)
{
- XINE_ASSERT( d,"value 'd' is NULL");
- XINE_ASSERT( dp, "value 'dp' is NULL");
- XINE_ASSERT( e, "value 'e' is NULL");
- XINE_ASSERT( dpp, "value 'dpp' is NULL");
- XINE_ASSERT( Nc, "value 'Nc' is NULL");
- XINE_ASSERT( bc, "value 'bc' is NULL" );
+ _x_assert( d );
+ _x_assert( dp );
+ _x_assert( e );
+ _x_assert( dpp );
+ _x_assert( Nc );
+ _x_assert( bc );
#if defined(FAST) && defined(USE_FLOAT_MUL)
if (S->fast)
@@ -935,7 +935,7 @@ void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp),
*/
Nr = Ncr < 40 || Ncr > 120 ? S->nrp : Ncr;
S->nrp = Nr;
- XINE_ASSERT(Nr >= 40 && Nr <= 120, "value 'Nr' is not within range of 40 to 120: %d", Nr);
+ _x_assert(Nr >= 40 && Nr <= 120);
/* Decoding of the LTP gain bcr
*/
@@ -944,7 +944,7 @@ void Gsm_Long_Term_Synthesis_Filtering P5((S,Ncr,bcr,erp,drp),
/* Computation of the reconstructed short term residual
* signal drp[0..39]
*/
- XINE_ASSERT(brp != MIN_WORD, "value 'brp' is equal to MIN_WORD");
+ _x_assert(brp != MIN_WORD);
for (k = 0; k <= 39; k++) {
drpp = GSM_MULT_R( brp, drp[ k - Nr ] );
diff --git a/src/libxineadec/gsm610/lpc.c b/src/libxineadec/gsm610/lpc.c
index 461f0b70f..0f51fa55f 100644
--- a/src/libxineadec/gsm610/lpc.c
+++ b/src/libxineadec/gsm610/lpc.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/lpc.c,v 1.2 2003/02/28 02:51:50 storri Exp $ */
+/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/lpc.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
#include <stdio.h>
#include "xineutils.h"
@@ -54,7 +54,7 @@ static void Autocorrelation P2((s, L_ACF),
*/
if (smax == 0) scalauto = 0;
else {
- XINE_ASSERT(smax > 0, "Scale maximum (smax) is not greater than 0: %d", smax);
+ _x_assert(smax > 0);
scalauto = 4 - gsm_norm( (longword)smax << 16 );/* sub(4,..) */
}
@@ -139,7 +139,7 @@ static void Autocorrelation P2((s, L_ACF),
/* Rescaling of the array s[0..159]
*/
if (scalauto > 0) {
- XINE_ASSERT(scalauto <= 4, "scalauto is not <= 4: %d", scalauto);
+ _x_assert(scalauto <= 4);
for (k = 160; k--; *s++ <<= scalauto) ;
}
}
@@ -194,10 +194,10 @@ static void Reflection_coefficients P2( (L_ACF, r),
return;
}
- XINE_ASSERT( L_ACF[0] != 0 , "L_ACF[0] is NULL");
+ _x_assert( L_ACF[0] != 0 );
temp = gsm_norm( L_ACF[0] );
- XINE_ASSERT(temp >= 0 && temp < 32, "temp is not within range 0 to 32: %d", temp);
+ _x_assert(temp >= 0 && temp < 32);
/* ? overflow ? */
for (i = 0; i <= 8; i++) ACF[i] = SASR( L_ACF[i] << temp, 16 );
@@ -221,11 +221,11 @@ static void Reflection_coefficients P2( (L_ACF, r),
*r = gsm_div( temp, P[0] );
- XINE_ASSERT(*r >= 0, "value 'r' is not >= 0: %d", *r);
+ _x_assert(*r >= 0);
if (P[1] > 0) *r = -*r; /* r[n] = sub(0, r[n]) */
- XINE_ASSERT (*r != MIN_WORD, "value 'r' is equal to MIN_WORD: %d", *r);
+ _x_assert(*r != MIN_WORD);
if (n == 8) return;
@@ -268,15 +268,15 @@ static void Transformation_to_Log_Area_Ratios P1((r),
temp = *r;
temp = GSM_ABS(temp);
- XINE_ASSERT(temp >= 0, "value 'temp' is not >= 0: %d", temp);
+ _x_assert(temp >= 0);
if (temp < 22118) {
temp >>= 1;
} else if (temp < 31130) {
- XINE_ASSERT(temp >= 11059, "value 'temp' is not >= 11059: %d", temp);
+ _x_assert(temp >= 11059);
temp -= 11059;
} else {
- XINE_ASSERT(temp >= 26112, "value 'temp' is not >= 26112: %d", temp);
+ _x_assert(temp >= 26112);
temp -= 26112;
temp <<= 2;
}
@@ -287,7 +287,7 @@ static void Transformation_to_Log_Area_Ratios P1((r),
else {
*r = temp;
}
- XINE_ASSERT (*r != MIN_WORD, "value 'r' is equal to MIN_WORD: %d", *r);
+ _x_assert(*r != MIN_WORD);
}
}
diff --git a/src/libxineadec/gsm610/rpe.c b/src/libxineadec/gsm610/rpe.c
index 4a9751cfa..67d94d30e 100644
--- a/src/libxineadec/gsm610/rpe.c
+++ b/src/libxineadec/gsm610/rpe.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/rpe.c,v 1.2 2003/02/28 02:51:50 storri Exp $ */
+/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/rpe.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
#include <stdio.h>
#include "xineutils.h"
@@ -141,7 +141,7 @@ static void RPE_grid_selection P3((x,xM,Mc_out),
*
* temp1 = SASR( x[m + 3*i], 2 );
*
- * XINE_ASSERT(temp1 != MIN_WORD,"temp1 equals MIN_WORD");
+ * _x_assert(temp1 != MIN_WORD);
*
* L_temp = GSM_L_MULT( temp1, temp1 );
* L_result = GSM_L_ADD( L_temp, L_result );
@@ -245,8 +245,8 @@ static void APCM_quantization_xmaxc_to_exp_mant P3((xmaxc,exp_out,mant_out),
mant -= 8;
}
- XINE_ASSERT( exp >= -4 && exp <= 6,"exp is not within range of -4 to 6: %d", exp );
- XINE_ASSERT( mant >= 0 && mant <= 7,"mant is not within range of 0 to 7: %d", mant );
+ _x_assert( exp >= -4 && exp <= 6 );
+ _x_assert( mant >= 0 && mant <= 7 );
*exp_out = exp;
*mant_out = mant;
@@ -289,14 +289,14 @@ static void APCM_quantization P5((xM,xMc,mant_out,exp_out,xmaxc_out),
itest |= (temp <= 0);
temp = SASR( temp, 1 );
- XINE_ASSERT(exp <= 5, "exp is greater than 5: %d", exp);
+ _x_assert(exp <= 5);
if (itest == 0) exp++; /* exp = add (exp, 1) */
}
- XINE_ASSERT(exp <= 6 && exp >= 0, "exp is not within range of 0 to 6: %d", exp);
+ _x_assert(exp <= 6 && exp >= 0);
temp = exp + 5;
- XINE_ASSERT(temp <= 11 && temp >= 0, "temp is within range of 0 to 11: %d", temp);
+ _x_assert(temp <= 11 && temp >= 0);
xmaxc = gsm_add( SASR(xmax, temp), exp << 3 );
/* Quantizing and coding of the xM[0..12] RPE sequence
@@ -319,15 +319,15 @@ static void APCM_quantization P5((xM,xMc,mant_out,exp_out,xmaxc_out),
/* Direct computation of xMc[0..12] using table 4.5
*/
- XINE_ASSERT((exp <= 4096) && (exp >= -4096), "exp is not within range of -4069 to 4096: %d", exp );
- XINE_ASSERT((mant >= 0) && (mant <= 7), "mant is not within range of 0 to 7: %d", mant );
+ _x_assert((exp <= 4096) && (exp >= -4096));
+ _x_assert((mant >= 0) && (mant <= 7));
temp1 = 6 - exp; /* normalization by the exponent */
temp2 = gsm_NRFAC[ mant ]; /* inverse mantissa */
for (i = 0; i <= 12; i++) {
- XINE_ASSERT(temp1 >= 0 && temp1 < 16, "temp1 is not within range of 0 to 15: %d", temp1);
+ _x_assert(temp1 >= 0 && temp1 < 16);
temp = xM[i] << temp1;
temp = GSM_MULT( temp, temp2 );
@@ -360,21 +360,21 @@ static void APCM_inverse_quantization P4((xMc,mant,exp,xMp),
word temp, temp1, temp2, temp3;
longword ltmp;
- XINE_ASSERT((mant >= 0) && (mant <= 7), "mant is not within range of 0 to 7: %d", mant );
+ _x_assert((mant >= 0) && (mant <= 7));
temp1 = gsm_FAC[ mant ]; /* see 4.2-15 for mant */
temp2 = gsm_sub( 6, exp ); /* see 4.2-15 for exp */
temp3 = gsm_asl( 1, gsm_sub( temp2, 1 ));
for (i = 13; i--;) {
- XINE_ASSERT((mant >= 0) && (mant <= 7), "mant is not within range of 0 to 7: %d", mant );
+ _x_assert((mant >= 0) && (mant <= 7));
- XINE_ASSERT((*xMc <= 7) && (*xMc >= 0), "xMc is not 3 bit unsigned: %d", *xMc ); /* 3 bit unsigned */
+ _x_assert((*xMc <= 7) && (*xMc >= 0)); /* 3 bit unsigned */
/* temp = gsm_sub( *xMc++ << 1, 7 ); */
temp = (*xMc++ << 1) - 7; /* restore sign */
- XINE_ASSERT((temp <= 7) && (temp >= -7), "temp is not 4 bit signed: %d", temp); /* 4 bit signed */
+ _x_assert((temp <= 7) && (temp >= -7)); /* 4 bit signed */
temp <<= 12; /* 16 bit signed */
temp = GSM_MULT_R( temp1, temp );
@@ -400,7 +400,7 @@ static void RPE_grid_positioning P3((Mc,xMp,ep),
{
int i = 13;
- XINE_ASSERT((0 <= Mc) && (Mc <= 3), "Mc is not within the range of 0 to 3: %d", Mc);
+ _x_assert((0 <= Mc) && (Mc <= 3));
switch (Mc) {
case 3: *ep++ = 0;
diff --git a/src/libxineadec/gsm610/short_term.c b/src/libxineadec/gsm610/short_term.c
index 52ac623d2..8222b2caa 100644
--- a/src/libxineadec/gsm610/short_term.c
+++ b/src/libxineadec/gsm610/short_term.c
@@ -4,7 +4,7 @@
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
-/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/short_term.c,v 1.2 2003/02/28 02:51:50 storri Exp $ */
+/* $Header: /nfshome/cvs/xine-lib/src/libxineadec/gsm610/short_term.c,v 1.3 2003/12/07 15:34:30 f1rmb Exp $ */
#include <stdio.h>
#include "xineutils.h"
@@ -42,7 +42,7 @@ static void Decoding_of_the_coded_Log_Area_Ratios P2((LARc,LARpp),
* temp2 = *B << 1;
* temp1 = GSM_SUB( temp1, temp2 );
*
- * XINE_ASSERT(*INVA != MIN_WORD, "INVA table equlas MIN_WORD");
+ * _x_assert(*INVA != MIN_WORD);
*
* temp1 = GSM_MULT_R( *INVA, temp1 );
* *LARpp = GSM_ADD( temp1, temp1 );
diff --git a/src/video_out/alphablend.c b/src/video_out/alphablend.c
index 111f3fee3..f640fa38a 100644
--- a/src/video_out/alphablend.c
+++ b/src/video_out/alphablend.c
@@ -462,8 +462,7 @@ void blend_rgb16 (uint8_t * img, vo_overlay_t * img_overl,
}
break;
case 6: /* Finished */
- XINE_ASSERT(0,"Don't ever get here\n");
- /* This case will not fall through, XINE_ASSERT contains a call to abort() */
+ abort();
case 7: /* No button */
clut = (clut_t*) img_overl->color;
diff --git a/src/video_out/video_out_directfb.c b/src/video_out/video_out_directfb.c
index 63b099200..0ebd3ffe9 100644
--- a/src/video_out/video_out_directfb.c
+++ b/src/video_out/video_out_directfb.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_directfb.c,v 1.24 2003/12/05 15:55:03 f1rmb Exp $
+ * $Id: video_out_directfb.c,v 1.25 2003/12/07 15:34:30 f1rmb Exp $
*
* DirectFB based output plugin.
* Rich Wareham <richwareham@users.sourceforge.net>
@@ -353,8 +353,8 @@ static void directfb_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen
if( !overlay->rgb_clut || !overlay->clip_rgb_clut)
directfb_overlay_clut_yuv2rgb(this,overlay);
- XINE_ASSERT (this->delivered_width == frame->width, "Delivered frame width does not match desired width");
- XINE_ASSERT (this->delivered_height == frame->height, "Delivered frame height does not match desire height");
+ _x_assert(this->delivered_width == frame->width);
+ _x_assert(this->delivered_height == frame->height);
# if BYTES_PER_PIXEL == 3
blend_rgb24 ((uint8_t *)frame->texture, overlay,
frame->width, frame->height,
diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c
index be8be58ca..cc870ea1b 100644
--- a/src/video_out/video_out_opengl.c
+++ b/src/video_out/video_out_opengl.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_opengl.c,v 1.33 2003/12/05 15:55:03 f1rmb Exp $
+ * $Id: video_out_opengl.c,v 1.34 2003/12/07 15:34:30 f1rmb Exp $
*
* video_out_glut.c, glut based OpenGL rendering interface for xine
* Matthias Hopf <mat@mshopf.de>
@@ -339,7 +339,7 @@ static void opengl_update_frame_format (vo_driver_t *this_gen,
frame->chunk[0] = frame->chunk[1] = frame->chunk[2] = NULL;
frame->texture = calloc (1, BYTES_PER_PIXEL * image_size);
- XINE_ASSERT(frame->texture, "Frame texture is NULL");
+ _x_assert(frame->texture);
switch (format) {
case XINE_IMGFMT_YV12:
@@ -545,7 +545,7 @@ static void opengl_render_image (opengl_driver_t *this, opengl_frame_t *frame,
GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, None
} ;
- XINE_ASSERT (this->vinfo, "this->vinfo is NULL");
+ _x_assert(this->vinfo);
if ((this->context_state == CONTEXT_SAME_DRAWABLE) &&
(self == this->renderthread))
@@ -565,7 +565,7 @@ static void opengl_render_image (opengl_driver_t *this, opengl_frame_t *frame,
ctx = glXCreateContext (this->display, this->vinfo, NULL, True);
DEBUGF ((stderr, "created\n"));
- XINE_ASSERT(ctx, "ctx is NULL");
+ _x_assert(ctx);
this->context = ctx;
this->context_state = CONTEXT_RELOAD;
@@ -925,7 +925,7 @@ static vo_driver_t *opengl_open_plugin (video_driver_class_t *class_gen,
* allocate plugin struct
*/
this = calloc (1, sizeof (opengl_driver_t));
- XINE_ASSERT (this, "OpenGL driver struct is not defined");
+ _x_assert(this);
this->config = class->config;
this->xine = class->xine;
diff --git a/src/video_out/yuv2rgb_mlib.c b/src/video_out/yuv2rgb_mlib.c
index e1a7cba7d..d1c0d1ff5 100644
--- a/src/video_out/yuv2rgb_mlib.c
+++ b/src/video_out/yuv2rgb_mlib.c
@@ -83,7 +83,8 @@ static void mlib_yuv420_rgb24 (yuv2rgb_t *this,
dy = 0;
dst_height = this->next_slice (this, &image);
- XINE_ASSERT((this->dest_width&1) == 0, "mlib needs an even YUV2 width.");
+ /* mlib needs an even YUV2 width. */
+ _x_assert((this->dest_width&1) == 0);
for (;;) {
scale_line (pu, this->u_buffer,
@@ -161,7 +162,8 @@ static void mlib_yuv420_argb32 (yuv2rgb_t *this,
dy = 0;
dst_height = this->next_slice (this, &image);
- XINE_ASSERT((this->dest_width&1) == 0, "mlib needs an even YUV2 width");
+ /* mlib needs an even YUV2 width */
+ _x_assert((this->dest_width&1) == 0);
for (;;) {
scale_line (pu, this->u_buffer,
@@ -239,7 +241,8 @@ static void mlib_yuv420_abgr32 (yuv2rgb_t *this,
dy = 0;
dst_height = this->next_slice (this, &image);
- XINE_ASSERT ((this->dest_width&1) == 0, "mlib needs an even YUV2 width.");
+ /* mlib needs an even YUV2 width */
+ _x_assert((this->dest_width&1) == 0);
for (;;) {
scale_line (pu, this->u_buffer,
diff --git a/src/xine-engine/audio_out.c b/src/xine-engine/audio_out.c
index 6bd3ea0eb..8797dd3d6 100644
--- a/src/xine-engine/audio_out.c
+++ b/src/xine-engine/audio_out.c
@@ -17,7 +17,7 @@
* along with self program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_out.c,v 1.155 2003/12/05 15:55:04 f1rmb Exp $
+ * $Id: audio_out.c,v 1.156 2003/12/07 15:34:30 f1rmb Exp $
*
* 22-8-2001 James imported some useful AC3 sections from the previous alsa driver.
* (c) 2001 Andy Lo A Foe <andy@alsaplayer.org>
@@ -300,7 +300,7 @@ static void fifo_append_int (audio_fifo_t *fifo,
/* buf->next = NULL; */
- XINE_ASSERT(!buf->next, "Next audio buffer is not NULL.");
+ _x_assert(!buf->next);
if (!fifo->first) {
fifo->first = buf;
@@ -1067,7 +1067,7 @@ static void *ao_loop (void *this_gen) {
#endif
lprintf ("loop: writing %d samples to sound device\n", out_buf->num_frames);
-
+
pthread_mutex_lock( &this->driver_lock );
result = this->driver->write (this->driver, out_buf->mem, out_buf->num_frames );
pthread_mutex_unlock( &this->driver_lock );
@@ -1077,8 +1077,10 @@ static void *ao_loop (void *this_gen) {
* Maybe we should pause the stream until the USB device is plugged in again.
* Return values 0 happen even if usb not unplugged, so needs further investigation.
*/
- XINE_ASSERT(result >= 0, "write to sound card failed. Was a USB device unplugged?");
+ xprintf(this->xine, XINE_VERBOSITY_LOG, _("write to sound card failed. Was a USB device unplugged ?\n"));
+ _x_assert(result >= 0);
+
lprintf ("loop: next buf from fifo\n");
fifo_append (this->free_fifo, in_buf);
in_buf = NULL;
diff --git a/src/xine-engine/buffer.c b/src/xine-engine/buffer.c
index a6e92060a..1f7c896d6 100644
--- a/src/xine-engine/buffer.c
+++ b/src/xine-engine/buffer.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: buffer.c,v 1.33 2003/11/20 00:42:14 tmattern Exp $
+ * $Id: buffer.c,v 1.34 2003/12/07 15:34:30 f1rmb Exp $
*
*
* contents:
@@ -65,7 +65,7 @@ static void buffer_pool_free (buf_element_t *element) {
this->buffer_pool_num_free++;
if (this->buffer_pool_num_free > this->buffer_pool_capacity) {
printf("xine-lib:buffer: Their has been a fatal error: TOO MANY FREE's\n");
- assert(0);
+ abort();
}
pthread_cond_signal (&this->buffer_pool_cond_not_empty);
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c
index 80cd57641..775152640 100644
--- a/src/xine-engine/configfile.c
+++ b/src/xine-engine/configfile.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: configfile.c,v 1.58 2003/12/05 15:55:04 f1rmb Exp $
+ * $Id: configfile.c,v 1.59 2003/12/07 15:34:30 f1rmb Exp $
*
* config object (was: file) management - implementation
*
@@ -203,8 +203,8 @@ static char *__config_register_string (config_values_t *this,
cfg_entry_t *entry, *prev;
- XINE_ASSERT(key, "Register key is NULL. This is a required argument.");
- XINE_ASSERT(def_value, "Default value is NULL. This is a required argument.");
+ _x_assert(key);
+ _x_assert(def_value);
lprintf ("registering %s\n", key);
@@ -266,7 +266,7 @@ static int __config_register_num (config_values_t *this,
void *cb_data) {
cfg_entry_t *entry, *prev;
- XINE_ASSERT(key, "Register key is NULL. This is a required argument.");
+ _x_assert(key);
lprintf ("registering %s\n", key);
@@ -331,7 +331,7 @@ static int __config_register_bool (config_values_t *this,
void *cb_data) {
cfg_entry_t *entry, *prev;
- XINE_ASSERT(key, "Register key is NULL. This is a required argument.");
+ _x_assert(key);
lprintf ("registering %s\n", key);
@@ -397,7 +397,7 @@ static int __config_register_range (config_values_t *this,
void *cb_data) {
cfg_entry_t *entry, *prev;
- XINE_ASSERT(key, "Register key is NULL. This is a required argument.");
+ _x_assert(key);
lprintf ("registering range %s\n", key);
@@ -489,8 +489,8 @@ static int __config_register_enum (config_values_t *this,
void *cb_data) {
cfg_entry_t *entry, *prev;
- XINE_ASSERT(key, "Register key is NULL. This is a required argument.");
- XINE_ASSERT(values, "Argument 'values' is NULL. This is a required argument.");
+ _x_assert(key);
+ _x_assert(values);
lprintf ("registering enum %s\n", key);
@@ -909,8 +909,8 @@ static void __config_unregister_cb (config_values_t *this, const char *key) {
cfg_entry_t *entry;
- XINE_ASSERT(key, "Register key is NULL. This is a required argument.");
- XINE_ASSERT(this, "Argument 'this' is NULL. Cannot find key if this is not set.");
+ _x_assert(key);
+ _x_assert(this);
entry = __config_lookup_entry (this, key);
if (entry) {
diff --git a/src/xine-engine/lrb.c b/src/xine-engine/lrb.c
index 3f7189fad..1e767a48d 100644
--- a/src/xine-engine/lrb.c
+++ b/src/xine-engine/lrb.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: lrb.c,v 1.6 2003/12/06 18:11:56 mroi Exp $
+ * $Id: lrb.c,v 1.7 2003/12/07 15:34:31 f1rmb Exp $
*
*/
@@ -48,7 +48,7 @@ void lrb_drop (lrb_t *this) {
buf_element_t *buf = this->oldest;
- XINE_ASSERT(buf, "Oldest buffer element is NULL");
+ _x_assert(buf);
this->oldest = buf->next;
diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c
index d4fd58d94..fee032df3 100644
--- a/src/xine-engine/osd.c
+++ b/src/xine-engine/osd.c
@@ -1149,29 +1149,30 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in
}
static void osd_preload_fonts (osd_renderer_t *this, char *path) {
- DIR *dir;
- osd_font_t *font;
- char *pathname;
- char *s, *p;
+ DIR *dir;
+ char *s, *p;
lprintf ("path='%s'\n", path);
- dir = opendir (path) ;
+ dir = opendir (path);
if (dir) {
-
- struct dirent *entry;
+ struct dirent *entry;
while ((entry = readdir (dir)) != NULL) {
- int len;
+ int len;
len = strlen (entry->d_name);
-
- if ( (len>12) && !strncmp (&entry->d_name[len-12], ".xinefont.gz", 12)) {
+
+ if ( (len > 12) && !strncmp (&entry->d_name[len-12], ".xinefont.gz", 12)) {
s = strdup(entry->d_name);
p = strchr(s, '-');
+
if( p ) {
+ osd_font_t *font;
+ char *pathname;
+
*p++ = '\0';
font = xine_xmalloc( sizeof(osd_font_t) );
@@ -1181,7 +1182,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 = malloc(1024);
+ pathname = (char *) xine_xmalloc(strlen(path) + strlen(entry->d_name) + 2);
sprintf (pathname, "%s/%s", path, entry->d_name);
font->filename = pathname;
diff --git a/src/xine-engine/vo_scale.c b/src/xine-engine/vo_scale.c
index 170e3158a..870811c34 100644
--- a/src/xine-engine/vo_scale.c
+++ b/src/xine-engine/vo_scale.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: vo_scale.c,v 1.27 2003/11/26 19:43:38 f1rmb Exp $
+ * $Id: vo_scale.c,v 1.28 2003/12/07 15:34:31 f1rmb Exp $
*
* Contains common code to calculate video scaling parameters.
* In short, it will map frame dimensions to screen/window size.
@@ -79,7 +79,7 @@ void _x_vo_scale_compute_ideal_size (vo_scale_t *this) {
this->video_pixel_aspect = desired_ratio / image_ratio;
- XINE_ASSERT(this->gui_pixel_aspect != 0.0, "GUI pixel aspect is not 0.0: %f",this->gui_pixel_aspect);
+ _x_assert(this->gui_pixel_aspect != 0.0);
if (fabs (this->video_pixel_aspect / this->gui_pixel_aspect - 1.0)
< 0.01) {
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index 0003eaea8..a7c0aca0a 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_interface.c,v 1.71 2003/12/05 15:55:05 f1rmb Exp $
+ * $Id: xine_interface.c,v 1.72 2003/12/07 15:34:31 f1rmb Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -54,7 +54,11 @@
*/
const char *xine_get_version_string(void) {
- return VERSION;
+ return VERSION
+#ifndef NDEBUG
+ "[DEBUG]"
+#endif
+ ;
}
void xine_get_version (int *major, int *minor, int *sub) {
diff --git a/src/xine-utils/utils.c b/src/xine-utils/utils.c
index 3e7ec7f6b..b351ac860 100644
--- a/src/xine-utils/utils.c
+++ b/src/xine-utils/utils.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: utils.c,v 1.21 2003/12/06 16:10:01 miguelfreitas Exp $
+ * $Id: utils.c,v 1.22 2003/12/07 15:34:31 f1rmb Exp $
*
*/
#define _POSIX_PTHREAD_SEMANTICS 1 /* for 5-arg getpwuid_r on solaris */
@@ -142,32 +142,6 @@ void xine_usec_sleep(unsigned usec) {
#endif
}
-
-/* Obtain a backtrace and print it to stdout. */
-void xine_print_trace (void) {
-#if HAVE_BACKTRACE
- /* Code Taken from GNU C Library manual */
- void *array[10];
- size_t size;
- char **strings;
- size_t i;
-
- size = backtrace (array, 10);
- strings = backtrace_symbols (array, size);
-
- printf ("Obtained %lu stack frames.\n", (unsigned long) size);
-
- for (i = 0; i < size; i++) {
- printf ("%s\n", strings[i]);
- }
- free (strings);
-#elif HAVE_PRINTSTACK
- printstack(STDOUT_FILENO);
-#else
- printf("stack backtrace not available.\n");
-#endif
-}
-
/* print a hexdump of length bytes from the data given in buf */
void xine_hexdump (const char *buf, int length) {
int i,j;
diff --git a/src/xine-utils/xineutils.h b/src/xine-utils/xineutils.h
index 46aa3d12d..5e4c81f16 100644
--- a/src/xine-utils/xineutils.h
+++ b/src/xine-utils/xineutils.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xineutils.h,v 1.70 2003/12/06 18:15:56 mroi Exp $
+ * $Id: xineutils.h,v 1.71 2003/12/07 15:34:31 f1rmb Exp $
*
*/
#ifndef XINEUTILS_H
@@ -830,9 +830,6 @@ extern int v_b_table[256];
/* print a hexdump of the given data */
void xine_hexdump (const char *buf, int length);
-/* backtrace printout funtion for use in XINE_ASSERT() macro */
-void xine_print_trace(void);
-
/*
* Optimization macros for conditions
* Taken from the FIASCO L4 microkernel sources
@@ -844,64 +841,23 @@ void xine_print_trace(void);
# define EXPECT_TRUE(x) __builtin_expect((x),1)
# define EXPECT_FALSE(x) __builtin_expect((x),0)
#endif
-
-#ifdef DEBUG
-# define XINE_ABORT() \
- abort();
-#else
-# define XINE_ABORT() \
- /* don't abort, but print warning */ \
- printf("%s: OOPS, your player reached a bad state\n", __FILE__); \
- printf("%s: please send a report with the full console output to the xine team.\n", __FILE__);
-#endif
-
-/**
- * Provide assert like feature with better description of failure
- * Thanks to Mark Thomas
- */
-#ifdef __GNUC__
-# define XINE_ASSERT(exp, desc, args...) \
- do { \
- if (!(exp)) { \
- printf("%s:%s:%d: assertion `%s' failed. " desc "\n\n", \
- __FILE__, __XINE_FUNCTION__, __LINE__, #exp, ##args); \
- xine_print_trace(); \
- XINE_ABORT(); \
- } \
- } while(0)
-#else /* not GNU C, assume we have a C99 compiler */
-
-#ifdef _MSC_VER
-/*
- #define XINE_ASSERT(exp, desc) ((void)((exp) || \
- (printf desc, _assert(#exp, __FILE__, __LINE__), 0)))
-
-*/
-# define XINE_ASSERT(exp, desc) \
- do { \
- if (!(exp)) { \
- printf("%s:%s:%d: assertion `%s' failed. ", \
- __FILE__, __XINE_FUNCTION__, __LINE__, #exp); \
- printf(desc); \
- printf("\n\n"); \
- xine_print_trace(); \
- XINE_ABORT(); \
- } \
+
+#ifdef NDEBUG
+#define _x_assert(exp) \
+ do { \
+ if (!(exp)) \
+ fprintf(stderr, "%s:%s:%d: Assertion `%s' failed.\n", \
+ __FILE__, __XINE_FUNCTION__, __LINE__, #exp); \
} while(0)
#else
-# define XINE_ASSERT(exp, ...) \
- do { \
- if (!(exp)) { \
- printf("%s:%s:%d: assertion `%s' failed. ", \
- __FILE__, __XINE_FUNCTION__, __LINE__, #exp); \
- printf(__VA_ARGS__); \
- printf("\n\n"); \
- xine_print_trace(); \
- XINE_ABORT(); \
- } \
+#define _x_assert(exp) \
+ do { \
+ if (!(exp)) { \
+ fprintf(stderr, "%s:%s:%d: Assertion `%s' failed.\n", \
+ __FILE__, __XINE_FUNCTION__, __LINE__, #exp); \
+ abort(); \
+ } \
} while(0)
-#endif /* _MSC_VER */
-
#endif
/****** logging with xine **********************************/