Don't repeat file that can't advance its position.
This avoids a confusing condition when hackrf_transfer is reading from stdin with -R in which it does not repeat previous data but repeatedly restarts reading new data after the user types Ctrl-D to indicate EOF. The -R option should repeat previous data or should do nothing if the input file cannot be rewound.
This commit is contained in:
@ -543,7 +543,7 @@ int tx_callback(hackrf_transfer* transfer)
|
||||
}
|
||||
|
||||
/* Otherwise, the file ran short. If not repeating, this is the last data. */
|
||||
if (!repeat) {
|
||||
if ((!repeat) || (ftell(file) < 1)) {
|
||||
tx_complete = true;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user