Changeset 775

Show
Ignore:
Timestamp:
12/24/07 03:21:13 (13 years ago)
Author:
ppalmers
Message:

- sleep before AGAIN, fixed deadlock

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/src/libstreaming/generic/StreamProcessor.cpp

    r766 r775  
    106106StreamProcessor::getNbPacketsIsoXmitBuffer() 
    107107{ 
    108     return (getPacketsPerPeriod() * 1000)/1000; 
     108    // the target is to have all of the transmit buffer (at period transfer) as ISO packets 
     109    // when one period is received, there will be approx (NbBuffers - 1) * period_size frames 
     110    // in the transmit buffer (the others are still to be put into the xmit frame buffer) 
     111    unsigned int packets_to_prebuffer = (getPacketsPerPeriod() * (m_StreamProcessorManager.getNbBuffers()-1)); 
     112     
     113    // however we have to take into account the fact that there is some sync delay (unknown at this point) 
     114    packets_to_prebuffer -= 16; //FIXME: magic 
     115     
     116    return packets_to_prebuffer; 
    109117} 
    110118 
     
    607615                } 
    608616            } 
    609             //usleep(125); // only when using thread per handler mode! 
     617            usleep(125); // only when using thread per handler mode! 
    610618            return RAW1394_ISO_AGAIN; 
    611619        } else {