diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-11-23 21:37:48 +0100 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-11-23 21:41:02 +0100 |
commit | 4c4d62f248d1c58a0cbd35d19f8ffda9bb4551f7 (patch) | |
tree | c82d69fcc075448efbc69b72ed2094852ef1014a | |
parent | 72e5368aedd7eb964c1dcc14f11fa3188e9368c6 (diff) | |
download | libraw1394-4c4d62f248d1c58a0cbd35d19f8ffda9bb4551f7.tar.gz |
Addendum to 'Calculate iso receive cycles on firewire-core'
The number of packets is a 4th of the number of header bytes (in case of
ABI version 1). Also, wrap after an increment over 8000.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
-rw-r--r-- | src/fw-iso.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/fw-iso.c b/src/fw-iso.c index 677b98d..88909dc 100644 --- a/src/fw-iso.c +++ b/src/fw-iso.c @@ -196,7 +196,7 @@ flush_recv_packets(raw1394handle_t handle, cycle = interrupt->cycle; cycle &= 0x1fff; cycle += 8000; - cycle -= end - p; + cycle -= interrupt->header_length / 4; } dropped = 0; @@ -211,8 +211,11 @@ flush_recv_packets(raw1394handle_t handle, if (header_has_timestamp) cycle = be32_to_cpu(*p++) & 0x1fff; - else + else { cycle++; + if (cycle >= 8000) + cycle -= 8000; + } d = fwhandle->iso.recv_handler(handle, fwhandle->iso.tail, len, channel, tag, sy, cycle, dropped); |