- OSD_PROFILING is now an environment variable. No more recompiling to turn profiling on

- Added two asserts to task processing
This commit is contained in:
Couriersud 2009-10-12 10:17:23 +00:00
parent e60cd95d44
commit a4054be2b3

View File

@ -89,7 +89,7 @@ static DEVICE_RESET( discrete );
static STREAM_UPDATE( discrete_stream_update ); static STREAM_UPDATE( discrete_stream_update );
static STREAM_UPDATE( buffer_stream_update ); static STREAM_UPDATE( buffer_stream_update );
static int profiling = DISCRETE_PROFILING; static int profiling = 0;
/************************************* /*************************************
* *
@ -499,6 +499,10 @@ static DEVICE_START( discrete )
if (DISCRETE_DEBUGLOG) if (DISCRETE_DEBUGLOG)
info->disclogfile = fopen(name, "w"); info->disclogfile = fopen(name, "w");
/* enable profiling */
if (getenv("DISCRETE_PROFILING"))
profiling = atoi(getenv("DISCRETE_PROFILING"));
/* Build the final block list */ /* Build the final block list */
info->block_list = NULL; info->block_list = NULL;
intf = &info->block_list; intf = &info->block_list;
@ -692,11 +696,13 @@ static void *task_callback(void *param, int threadid)
int avail; int avail;
avail = sn->task->ptr[sn->output_node] - sn->ptr; avail = sn->task->ptr[sn->output_node] - sn->ptr;
assert_always(avail >= 0, "task_callback: available samples are negative");
if (avail < samples) if (avail < samples)
samples = avail; samples = avail;
} }
task->samples -= samples; task->samples -= samples;
assert_always(task->samples >=0, "task_callback: task_samples got negative");
while (samples > 0) while (samples > 0)
{ {
/* step */ /* step */