Logo Search packages:      
Sourcecode: pulseaudio version File versions

int pa_stream_cancel_write ( pa_stream p  ) 

Reverses the effect of pa_stream_begin_write() dropping all data that has already been placed in the memory area returned by pa_stream_begin_write(). Only valid to call if pa_stream_begin_write() was called before and neither pa_stream_cancel_write() nor pa_stream_write() have been called yet. Accessing the memory previously returned by pa_stream_begin_write() after this call is invalid. Any further explicit freeing of the memory area is not necessary.

Since:
0.9.16

Definition at line 1232 of file stream.c.

References PA_ERR_BADSTATE, PA_ERR_FORKED, PA_STREAM_PLAYBACK, PA_STREAM_READY, and PA_STREAM_UPLOAD.

                      {

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

    PA_CHECK_VALIDITY(s->context, !pa_detect_fork(), PA_ERR_FORKED);
    PA_CHECK_VALIDITY(s->context, s->state == PA_STREAM_READY, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY(s->context, s->direction == PA_STREAM_PLAYBACK || s->direction == PA_STREAM_UPLOAD, PA_ERR_BADSTATE);
    PA_CHECK_VALIDITY(s->context, s->write_memblock, PA_ERR_BADSTATE);

    pa_assert(s->write_data);

    pa_memblock_release(s->write_memblock);
    pa_memblock_unref(s->write_memblock);
    s->write_memblock = NULL;
    s->write_data = NULL;

    return 0;
}


Generated by  Doxygen 1.6.0   Back to index