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

pa_operation* pa_stream_flush ( pa_stream s,
pa_stream_success_cb_t  cb,
void *  userdata 
)

Flush the playback buffer of this stream. Most of the time you're better off using the parameter delta of pa_stream_write() instead of this function. Available on both playback and recording streams.

Since:
0.3

Definition at line 1380 of file stream.c.

References PA_ERR_BADSTATE, PA_STREAM_PLAYBACK, and PA_STREAM_UPLOAD.

                                                                                       {
    pa_operation *o;

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

    PA_CHECK_VALIDITY_RETURN_NULL(s->context, s->direction != PA_STREAM_UPLOAD, PA_ERR_BADSTATE);

    if ((o = stream_send_simple_command(s, s->direction == PA_STREAM_PLAYBACK ? PA_COMMAND_FLUSH_PLAYBACK_STREAM : PA_COMMAND_FLUSH_RECORD_STREAM, cb, userdata))) {

        if (s->direction == PA_STREAM_PLAYBACK) {
            if (s->write_index_corrections[s->current_write_index_correction].valid)
                s->write_index_corrections[s->current_write_index_correction].corrupt = 1;

            if (s->timing_info_valid)
                s->timing_info.write_index_corrupt = 1;

            if (s->buffer_attr.prebuf > 0)
                invalidate_indexes(s, 1, 0);
            else
                request_auto_timing_update(s, 1);
        } else
            invalidate_indexes(s, 0, 1);
    }

    return o;
}


Generated by  Doxygen 1.6.0   Back to index