[Live-devel] Running openRTSP

tjc103 at ecs.soton.ac.uk tjc103 at ecs.soton.ac.uk
Fri Jul 21 08:05:50 PDT 2006


Hi,

I'm trying to integrate the openRTSP program into an existing application I
have. Initially while compiling I had a problem with NetCommon.h on the
line :

#define SOCKLEN_T int

changing this to :

#define SOCKLEN_T unsigned int

solved this completely. However the crux of my problem is with the PThreads.
At the moment I call the main (renamed to ip_main) function of playCommon
with pthread_create. Then when i want to end the openRTSP thread I issue a
pthread_kill(thread, SIGHUP) and wait for the thread to join. I've altered
the shutdown routine in playCommon to do a pthread_exit rather than exit.

This appears to work fine for starting and stopping the thread once, however
if I have qosMeasurementIntervalMS set to anything other than 0 I get a
segfault trying to start the thread again (it segfaults in the function
RTPSource::receptionStatsDB). I thought that this maybe due to some
variable not being cleared properly on shutdown of the openRTSP thread, but
env->taskScheduler().unscheduleDelayedTask(qosMeasurementTimerTask) is being
called fine.

If I do have qosMeasurementIntervalMS set to 0, then I can start and stop
threads fine, but there is an intermitent segfault while executing the
command pthread_exit. Doing a backtrace on this points to
pthread_mutex_unlock.

I'm not using any mutex locks at all (AFAIK I don't need to). However, just
to be sure I implemented pthread_mutex_lock at the start of openRTSP and
pthread_mutex_unlock just before the pthread_exit command is called - It
never segfaults on the pthread_mutex_unlock command I added, but will still
occasionly segfault on the pthread_exit command just after.

Does anybody have any experience with this? Is there a better way to start
and stop openRTSP (or playCommon) than using signals like hangup? I'm
guessing it may not be nescessary to stop it all, and have it idle in
someway.

Thanks

Theo






More information about the live-devel mailing list