From Stephan Huber, "Attached you'll find a new ImageSequence.cpp which will fix an issue I had when moving the mouse cursor over the left window-border, as the index becomes negative. And I added a UdpSocket.cpp-file with more debuggin-output via some sprinkled printf-calls. "

This commit is contained in:
Robert Osfield 2012-11-22 15:13:46 +00:00
parent 1f50f23f86
commit a31d603f9a
2 changed files with 10 additions and 5 deletions

View File

@ -353,10 +353,10 @@ void ImageSequence::update(osg::NodeVisitor* nv)
if (useDirectTimeRequest)
{
int i = int(time/_timePerImage);
int i = osg::maximum<int>(0, int(time/_timePerImage));
if ((i>=int(_imageDataList.size()) || !_imageDataList[i]._image))
{
i = osg::clampTo<int>(i, 0, _imageDataList.size()-1);
i = osg::minimum<int>(i, _imageDataList.size()-1);
OSG_INFO<<"Requesting file, entry="<<i<<" : _fileNames[i]="<<_imageDataList[i]._filename<<std::endl;
irh->requestImageFile(_imageDataList[i]._filename, this, i, time, fs, _imageDataList[i]._imageRequest, _readOptions.get());

View File

@ -191,7 +191,12 @@ public:
{
struct sockaddr_in bindSockAddr;
SockaddrFromIpEndpointName( bindSockAddr, localEndpoint );
{
IpEndpointName temp = IpEndpointNameFromSockaddr(bindSockAddr);
char address[30];
temp.AddressAndPortAsString(address);
printf("UdpSocket::Bind() %s \n", address);
}
if (bind(socket_, (struct sockaddr *)&bindSockAddr, sizeof(bindSockAddr)) < 0) {
throw std::runtime_error("unable to bind udp socket\n");
}
@ -420,7 +425,7 @@ public:
timeout.tv_usec = (long)((timeoutMs - (timeout.tv_sec * 1000)) * 1000);
timeoutPtr = &timeout;
}
printf("UdpSocket::Run() waiting for select \n");
if( select( fdmax + 1, &tempfds, 0, 0, timeoutPtr ) < 0 && errno != EINTR ){
throw std::runtime_error("select failed\n");
}
@ -438,7 +443,7 @@ public:
i != socketListeners_.end(); ++i ){
if( FD_ISSET( i->second->impl_->Socket(), &tempfds ) ){
printf("UdpSocket::Run() reading from socket \n");
int size = i->second->ReceiveFrom( remoteEndpoint, data, MAX_BUFFER_SIZE );
if( size > 0 ){
i->first->ProcessPacket( data, size, remoteEndpoint );