From 3aacc375a607ebe8d2ab74f5255234a4bb6f3414 Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Sat, 22 Apr 2006 16:00:39 +0000 Subject: [PATCH] fixed check for return values to enable mp3 support. git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@31 8eb893ce-cfd4-0310-b710-fb5ebe64c474 --- core/AmPlaylist.cpp | 2 +- core/AmSessionScheduler.cpp | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/core/AmPlaylist.cpp b/core/AmPlaylist.cpp index 603969a2..57d8cbde 100644 --- a/core/AmPlaylist.cpp +++ b/core/AmPlaylist.cpp @@ -67,7 +67,7 @@ int AmPlaylist::put(unsigned int user_ts, unsigned char* buffer, unsigned int si updateCurrentItem(); while(cur_item && cur_item->record && - (ret = cur_item->record->put(user_ts,buffer,size)) <= 0){ + (ret = cur_item->record->put(user_ts,buffer,size)) < 0){ DBG("put: gotoNextItem\n"); gotoNextItem(); diff --git a/core/AmSessionScheduler.cpp b/core/AmSessionScheduler.cpp index 07b9055a..883dc8db 100644 --- a/core/AmSessionScheduler.cpp +++ b/core/AmSessionScheduler.cpp @@ -171,14 +171,6 @@ void AmSessionSchedulerThread::run() while(true){ gettimeofday(&now,NULL); -// DBG("now: %i.%.6i; next_tick: %i.%.6i\n", -// now.tv_sec,now.tv_usec,next_tick.tv_sec,next_tick.tv_usec); - -// struct timeval elaps; -// timersub(&now, &elaps, &elaps); -// DBG("jitter: %i.%.6i; \n", -// elaps.tv_sec,elaps.tv_usec - tick.tv_usec); -// elaps = now; if(timercmp(&now,&next_tick,<)){ @@ -238,7 +230,7 @@ void AmSessionSchedulerThread::processAudio(unsigned int ts) case RTP_BUFFER_SIZE: default: ERROR("AmRtpAudio::receive() returned %i\n",ret); - postRequest(new SchedRequest(AmSessionScheduler::RemoveSession,s)); //removeSession(s); + postRequest(new SchedRequest(AmSessionScheduler::RemoveSession,s)); break; } } @@ -248,9 +240,9 @@ void AmSessionSchedulerThread::processAudio(unsigned int ts) if (input) { int ret = input->put(ts,buffer,size); - if(ret <= 0){ + if(ret < 0){ DBG("input->put() returned: %i\n",ret); - postRequest(new SchedRequest(AmSessionScheduler::RemoveSession,s)); //removeSession(s); + postRequest(new SchedRequest(AmSessionScheduler::RemoveSession,s)); } } if (s->isDtmfDetectionEnabled())