You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These do not work for buffers over 1024 samples, because they copy the first bytes in the input buffer repeatedly into the ltc write buffer. Here is suggested code for ltc.c:
#define CONVERSION_BUF_SIZE 1024
#define LTCWRITE_TEMPLATE(FN, FORMAT, CONV) \
void ltc_decoder_write_ ## FN (LTCDecoder *d, FORMAT *buf, size_t size, ltc_off_t posinfo) { \
ltcsnd_sample_t tmp[CONVERSION_BUF_SIZE]; \
size_t copyStart = 0; \
while (copyStart < size) { \
int c = size - copyStart; \
c = (c > CONVERSION_BUF_SIZE) ? CONVERSION_BUF_SIZE : c; \
int i; \
for (i=0; i<c; i++) { \
tmp[i] = CONV; \
} \
decode_ltc(d, tmp, c, posinfo + (ltc_off_t)c); \
copyStart += c; \
} \
}
LTCWRITE_TEMPLATE(float, float, 128 + (buf[copyStart+i] * 127.0))
/* this relies on the compiler to use an arithemtic right-shift for signed values */
LTCWRITE_TEMPLATE(s16, short, 128 + (buf[copyStart+i] >> 8))
/* this relies on the compiler to use a logical right-shift for unsigned values */
LTCWRITE_TEMPLATE(u16, unsigned short, (buf[copyStart+i] >> 8))
The text was updated successfully, but these errors were encountered:
Could you please post a diff (or file a pull request)- also for issue #7. That'll make it much more obvious and allow to comment on the changes. thanks.
These do not work for buffers over 1024 samples, because they copy the first bytes in the input buffer repeatedly into the ltc write buffer. Here is suggested code for ltc.c:
The text was updated successfully, but these errors were encountered: