Exemplo n.º 1
0
static void codec_advance_buffer_callback(size_t amount)
{
    if (!codec_advance_buffer_counters(amount))
        return;

    audio_codec_update_offset(ci.curpos);
}
Exemplo n.º 2
0
/* copy up-to size bytes into ptr and return the actual size copied */
static size_t codec_filebuf_callback(void *ptr, size_t size)
{
    ssize_t copy_n = bufread(ci.audio_hid, size, ptr);

    /* Nothing requested OR nothing left */
    if (copy_n <= 0)
        return 0;

    /* Update read and other position pointers */
    codec_advance_buffer_counters(copy_n);

    /* Return the actual amount of data copied to the buffer */
    return copy_n;
}
Exemplo n.º 3
0
/* copy up-to size bytes into ptr and return the actual size copied */
static size_t codec_filebuf_callback(void *ptr, size_t size)
{
    ssize_t copy_n;

    if (ci.stop_codec || !(audio_status() & AUDIO_STATUS_PLAY))
        return 0;

    copy_n = bufread(get_audio_hid(), size, ptr);

    /* Nothing requested OR nothing left */
    if (copy_n == 0)
        return 0;

    /* Update read and other position pointers */
    codec_advance_buffer_counters(copy_n);

    /* Return the actual amount of data copied to the buffer */
    return copy_n;
} /* codec_filebuf_callback */
Exemplo n.º 4
0
static void codec_advance_buffer_callback(size_t amount)
{
    codec_advance_buffer_counters(amount);
    codec_set_offset_callback(ci.curpos);
}