Code:
if (packetsrcvd == 250) //850
{
pID = fork();
if (pID == 0)
{
gettimeofday(&end, NULL);
cout << "Received after: " << endl;
if (end.tv_usec > start.tv_usec)
{
cout << end.tv_sec - start.tv_sec << ".";
cout << end.tv_usec - start.tv_usec << "s" << endl;
}
else if (end.tv_usec < start.tv_usec)
{
cout << end.tv_sec - start.tv_sec - 1 << ".";
cout << start.tv_usec - end.tv_usec + 1 << "s" << endl;
}
long counter = 0;
cout << "\nProcess created succesfully...";
cout << "\nPackets received = " << packetsrcvd;
cout << "\nYou have received " << rx << " bytes.";
execl("/opt/real/RealPlayer/realplay", "-o", "video_in.3gp", (char *) 0);
}
}
I'm programming in a unix environment. My aim is to start the player immediately without waiting for 250 packets to be received.
Given not enough data is received I get,
General error: HXR_CORRUPT_FILE (0x80040091) (file:///home/user/BTStream/BTStream/src/video_in.3gp) from the video player, but I'm doubtful if this error can be captured to the enviroment.
The reason I want to do this is to get the exact value and time at which I can start decoding.