output/jack: rename variable sample_size to jack_sample_size
This commit is contained in:
parent
2a1f4539f6
commit
ce370bee60
|
@ -36,7 +36,7 @@
|
||||||
#undef G_LOG_DOMAIN
|
#undef G_LOG_DOMAIN
|
||||||
#define G_LOG_DOMAIN "jack"
|
#define G_LOG_DOMAIN "jack"
|
||||||
|
|
||||||
static const size_t sample_size = sizeof(jack_default_audio_sample_t);
|
static const size_t jack_sample_size = sizeof(jack_default_audio_sample_t);
|
||||||
|
|
||||||
static const char *const port_names[2] = {
|
static const char *const port_names[2] = {
|
||||||
"left", "right",
|
"left", "right",
|
||||||
|
@ -118,14 +118,15 @@ mpd_jack_process(jack_nframes_t nframes, void *arg)
|
||||||
|
|
||||||
for (unsigned i = 0; i < G_N_ELEMENTS(jd->ringbuffer); ++i) {
|
for (unsigned i = 0; i < G_N_ELEMENTS(jd->ringbuffer); ++i) {
|
||||||
available = jack_ringbuffer_read_space(jd->ringbuffer[i]);
|
available = jack_ringbuffer_read_space(jd->ringbuffer[i]);
|
||||||
assert(available % sample_size == 0);
|
assert(available % jack_sample_size == 0);
|
||||||
available /= sample_size;
|
available /= jack_sample_size;
|
||||||
if (available > nframes)
|
if (available > nframes)
|
||||||
available = nframes;
|
available = nframes;
|
||||||
|
|
||||||
out = jack_port_get_buffer(jd->ports[i], nframes);
|
out = jack_port_get_buffer(jd->ports[i], nframes);
|
||||||
jack_ringbuffer_read(jd->ringbuffer[i],
|
jack_ringbuffer_read(jd->ringbuffer[i],
|
||||||
(char *)out, available * sample_size);
|
(char *)out,
|
||||||
|
available * jack_sample_size);
|
||||||
|
|
||||||
while (available < nframes)
|
while (available < nframes)
|
||||||
/* ringbuffer underrun, fill with silence */
|
/* ringbuffer underrun, fill with silence */
|
||||||
|
@ -430,7 +431,7 @@ mpd_jack_play(void *data, const void *chunk, size_t size, GError **error)
|
||||||
g_usleep(1000);
|
g_usleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
space /= sample_size;
|
space /= jack_sample_size;
|
||||||
if (space < size)
|
if (space < size)
|
||||||
size = space;
|
size = space;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue