Commit b0b7b6bc authored by d.basulto's avatar d.basulto

change some debug messages

parent b8dc7be7
......@@ -183,9 +183,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
if(((StreamRecorder*)user_data)->isConnectionLost) //Enter only if the connection is lost
{
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
long int actualRecordTime;
long int currentTime = time(NULL);
long int addTime;
......@@ -195,7 +193,6 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
//cout << "Actual time (timestamp): " << currentTime << endl;
actualRecordTime = currentTime-((StreamRecorder*)user_data)->timestamp;
cout << "Record time: " << actualRecordTime << endl;
// ----------------------------------------------------------------------------------------
/** The calculated record time is greater? */
......@@ -229,7 +226,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
((StreamRecorder*)user_data)->isConnectionLost = false;
/** Try reconnect with the radio stream*/
g_timeout_add(1*1000, reconnectURIStream, user_data);
g_timeout_add(RECONNECTION_DELAY*1000, reconnectURIStream, user_data);
}
break;
......@@ -256,20 +253,19 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
/** Not audio stream received */
if(((StreamRecorder*)user_data)->timestamp == 0)
{
g_timeout_add(1*1000, reconnectURIStream, user_data);
g_timeout_add(RECONNECTION_DELAY*1000, reconnectURIStream, user_data);
}
else
{
// ----------------------------------------------------------------------------------------
long int actualRecordTime;
long int currentTime = time(NULL);
//long int addTime;
long int bytesToAdd;
long int actualRecordTime;
long int currentTime = time(NULL);
long int addTime;
cout << "Actual time (timestamp): " << currentTime << endl;
actualRecordTime = currentTime - ((StreamRecorder *)user_data)->timestamp;
cout << "Record time: " << actualRecordTime << endl;
// ----------------------------------------------------------------------------------------
/** Record time is greater than th required */
if (actualRecordTime >= ((StreamRecorder *) user_data)->audioFileDuration)
......@@ -279,12 +275,12 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
}
else
{
/** Moves the pointer to the position corresponding to the difference of the timestamps */
addTime = currentTime - ((StreamRecorder *) user_data)->oldTmpTimestamp;
/** Moves the pointer to the position corresponding to the difference of the timestamps */
//addTime = currentTime - ((StreamRecorder *) user_data)->oldTmpTimestamp;
cout << "Time to add: " << 1 << endl;
long int bytesToAdd = 1*READSIZE*STREAMRECORDER_BYTESPERSAMPLE*10;
bytesToAdd = 1*READSIZE*STREAMRECORDER_BYTESPERSAMPLE*10;
cout << "-------------------------------------" << endl;
cout << "Actual Bytes number: " << "(" << ((StreamRecorder *) user_data)->nBytes << ") + ";
......@@ -303,7 +299,7 @@ int StreamRecorder::bus_callback (GstBus *bus, GstMessage *message, void *user_d
((StreamRecorder*)user_data)->isConnectionLost = false;
/** Try reconnect with the radio stream*/
g_timeout_add(1*1000, reconnectURIStream, user_data);
g_timeout_add(RECONNECTION_DELAY*1000, reconnectURIStream, user_data);
}
}
......
......@@ -26,6 +26,7 @@
#define ERROR_MSG_SIZE 50
#define DST_URI_SIZE 80
#define RECONNECTION_DELAY 1
//------------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment