android/ringlibsdl/project/jni/smpeg2-2.0.0/MPEGring.cpp
Uint32
MPEG_ring:: NextReadBuffer( Uint8** buffer )
{
    Uint32 size;

    size = 0;
    if ( ring->active ) {
        /* Wait for a buffer to become available */
//printf("Waiting for read buffer (%d available)\n", SDL_SemValue(ring->readwait));
        SDL_SemWait(ring->readwait);
//printf("Finished waiting for read buffer\n");
	if ( ring->active ) {
            size = *((Uint32*) ring->read);
            *buffer = ring->read + sizeof(Uint32);
        }
    }
    return size;
}
/*
  Returns the number of bytes in the next ring buffer and sets the buffer
  pointer to this buffer.  If there is no buffer ready then the buffer
  pointer is not changed and zero is returned.
*/
Returns the number of bytes in the next ring buffer and sets the buffer
pointer to this buffer.  If there is no buffer ready then the buffer
pointer is not changed and zero is returned.
Returns the number of bytes in the next ring buffer and sets the buffer pointer to this buffer . If there is no buffer ready then the buffer pointer is not changed and zero is returned .
Uint32
MPEG_ring:: NextReadBuffer( Uint8** buffer )
{
    Uint32 size;
    size = 0;
    if ( ring->active ) {
        SDL_SemWait(ring->readwait);
	if ( ring->active ) {
            size = *((Uint32*) ring->read);
            *buffer = ring->read + sizeof(Uint32);
        }
    }
    return size;
}
Uint32 MPEG_ring :: NextReadBuffer ( Uint8 * * buffer ) { Uint32 size ; size = 0 ; if ( ring -> active ) { SDL_SemWait ( ring -> readwait ) ; if ( ring -> active ) { size = * ( ( Uint32 * ) ring -> read ) ; * buffer = ring -> read + sizeof ( Uint32 ) ; } } return size ; }
Returns the number of bytes in the next ring buffer and sets the buffer
pointer to this buffer.
Returns the number of bytes in the next ring buffer and sets the buffer pointer to this buffer .
/* Wait for a buffer to become available */ //printf("Waiting for read buffer (%d available)\n", SDL_SemValue(ring->readwait)); //printf("Finished waiting for read buffer\n");