Logo Search packages:      
Sourcecode: pulseaudio version File versions  Download package

int pa_stream_drop ( pa_stream p  ) 

Remove the current fragment on record streams. It is invalid to do this without first calling pa_stream_peek().

Since:
0.8

Definition at line 922 of file stream.c.

References PA_ERR_BADSTATE, PA_STREAM_READY, and PA_STREAM_RECORD.

                                 {
    pa_assert(s);
    pa_assert(PA_REFCNT_VALUE(s) >= 1);

    PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_RECORD, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY(s->context, s->peek_memchunk.memblock, PA_ERR_BADSTATE);

    pa_memblockq_drop(s->record_memblockq, s->peek_memchunk.length);

    /* Fix the simulated local read index */
    if (s->timing_info_valid && !s->timing_info.read_index_corrupt)
        s->timing_info.read_index += s->peek_memchunk.length;

    pa_assert(s->peek_data);
    pa_memblock_release(s->peek_memchunk.memblock);
    pa_memblock_unref(s->peek_memchunk.memblock);
    s->peek_memchunk.length = 0;
    s->peek_memchunk.index = 0;
    s->peek_memchunk.memblock = NULL;

    return 0;
}


Generated by  Doxygen 1.6.0   Back to index