libbladeRF: Fixed #128.
Do not assert in the callback stream, but output some warning messages in case the sample stream does not have a valid integer number of samples.
This commit is contained in:
parent
94c23fe0e8
commit
75ef559cb7
1 changed files with 7 additions and 2 deletions
|
|
@ -1777,13 +1777,18 @@ static void LIBUSB_CALL lusb_stream_cb(struct libusb_transfer *transfer)
|
|||
else if( stream->state == STREAM_RUNNING ) {
|
||||
|
||||
/* Call user callback requesting more data to transmit */
|
||||
assert(transfer->length == transfer->actual_length);
|
||||
if (transfer->length != transfer->actual_length) {
|
||||
log_warning( "Received short transfer\n" );
|
||||
if ((transfer->actual_length & 3) != 0) {
|
||||
log_warning( "Fractional samples received - stream likely corrupt\n" );
|
||||
}
|
||||
}
|
||||
next_buffer = stream->cb(
|
||||
stream->dev,
|
||||
stream,
|
||||
&metadata,
|
||||
transfer->buffer,
|
||||
bytes_to_c16_samples(transfer->length),
|
||||
bytes_to_c16_samples(transfer->actual_length),
|
||||
stream->user_data
|
||||
);
|
||||
if( next_buffer == NULL ) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue