static void codec_advance_buffer_callback(size_t amount) { if (!codec_advance_buffer_counters(amount)) return; audio_codec_update_offset(ci.curpos); }
/* 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; }
/* 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 */
static void codec_advance_buffer_callback(size_t amount) { codec_advance_buffer_counters(amount); codec_set_offset_callback(ci.curpos); }