Logo Search packages:      
Sourcecode: pulseaudio version File versions

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().

Definition at line 1177 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 += (int64_t) s->peek_memchunk.length;

    pa_assert(s->peek_data);
    pa_memblock_release(s->peek_memchunk.memblock);
    pa_memblock_unref(s->peek_memchunk.memblock);
    pa_memchunk_reset(&s->peek_memchunk);

    return 0;
}


Generated by  Doxygen 1.6.0   Back to index