Esempio n. 1
0
/* Called from IO context */
static void sink_input_suspend_within_thread(pa_sink_input* i, pa_bool_t b) {
    struct session *s;
    pa_sink_input_assert_ref(i);
    pa_assert_se(s = i->userdata);

    if (b)
        pa_memblockq_flush_read(s->memblockq);
    else
        s->first_packet = FALSE;
}
/* Called from I/O thread context */
static void cmtspeech_sink_input_reset_dl_stream(struct userdata *u) {
    cmtspeech_dl_buf_t *buf;
    pa_assert(u);

    /* Flush all DL buffers */
    pa_memblockq_flush_read(u->dl_memblockq);
    cmtspeech_dl_sideinfo_flush(u);
    while ((buf = pa_asyncq_pop(u->cmt_connection.dl_frame_queue, FALSE))) {
        pa_memchunk cmtchunk;
        if (0 == cmtspeech_buffer_to_memchunk(u, buf, &cmtchunk))
            pa_memblock_unref(cmtchunk.memblock);
    }
}