[Media_api] assertion failed on input overflow

Julien Pommier pommier at pianoteq.com
Sat Dec 30 17:13:34 PST 2006


Hi,

Portmidi is really great, but I just noticed that an assertion is  
raised (using pm_mac , 30 oct 2006 release) when I fill the input  
buffer until it overflows. It is raised when I read the last event  
from the queue, in pmutil.c:291 :

     } else if (rslt == pmBufferOverflow) {
         /* peek should return pointer to valid data, but queue should
          * remain in overflow state, i.e. Pm_Dequeue() will return  
error
          */
         rslt = Pm_Dequeue(q, queue->peek);
         assert (rslt == 1); /* since we overflowed, there must be  
data */
         queue->peek_flag = TRUE;  /* now queue->peek has valid  
message */
         /* put queue in overflow state */
         queue->peek_overflow = TRUE;
         return queue->peek;
     }

I have just replaced the assert with an if in my test app, but I'm  
wondering if there is a better fix..

julien


More information about the media_api mailing list