chiark / gitweb /
realtime: avoid needless signalling problems related to interference
When we are considering an interfering segment, we want to first see
whether the segment has anything in it and only if so consider its
position. That avoids is calling it a problem that the interfering
segment's position is not known (eg, because it has never been set).
To support this, split segment_interferes into two functions:
segment_interferer: simply returns the possibly-interfering segment
so that we can check whether it's relevant
segment_interferer_does: does the hard work, dealing appropriately
with errors
At all but the one call site of interest we can assert that the
getmovpos callback never fails, so we provide a helper function
segment_interferes_simple
which does what segment_interferes used to (except that getmovpos
returning an error now causes an abort).