mirror of
https://github.com/rtlsdrblog/rtl-sdr-blog.git
synced 2024-11-06 10:47:35 +01:00
rtlsdr_read_async: buffer length must be multiple of 512
This commit is contained in:
parent
7ba990981b
commit
e4fef23874
@ -86,8 +86,8 @@ RTLSDR_API int rtlsdr_wait_async(rtlsdr_dev_t *dev, rtlsdr_read_async_cb_t cb, v
|
||||
* \param ctx user specific context to pass via the callback function
|
||||
* \param buf_num optional buffer count, buf_num * buf_len = overall buffer size
|
||||
* set to 0 for default buffer count (32)
|
||||
* \param buf_len optional buffer length, must be multiple of 2,
|
||||
* set to 0 for default buffer length (16 * 16384)
|
||||
* \param buf_len optional buffer length, must be multiple of 512,
|
||||
* set to 0 for default buffer length (16 * 32 * 512)
|
||||
* \return 0 on success
|
||||
*/
|
||||
RTLSDR_API int rtlsdr_read_async(rtlsdr_dev_t *dev,
|
||||
|
@ -141,7 +141,7 @@ static rtlsdr_device_t devices[] = {
|
||||
};
|
||||
|
||||
#define DEFAULT_BUF_NUMBER 32
|
||||
#define DEFAULT_BUF_LENGTH (16 * 16384)
|
||||
#define DEFAULT_BUF_LENGTH (16 * 32 * 512)
|
||||
|
||||
enum rtlsdr_async_status {
|
||||
RTLSDR_INACTIVE = 0,
|
||||
@ -891,7 +891,7 @@ int rtlsdr_read_async(rtlsdr_dev_t *dev, rtlsdr_read_async_cb_t cb, void *ctx,
|
||||
else
|
||||
dev->xfer_buf_num = DEFAULT_BUF_NUMBER;
|
||||
|
||||
if (buf_len > 0 && buf_len % 2 == 0) /* len must be multiple of 2 */
|
||||
if (buf_len > 0 && buf_len % 512 == 0) /* len must be multiple of 512 */
|
||||
dev->xfer_buf_len = buf_len;
|
||||
else
|
||||
dev->xfer_buf_len = DEFAULT_BUF_LENGTH;
|
||||
|
Loading…
Reference in New Issue
Block a user