[on-list again, again]
Am 30. August 2023 23:11:34 MESZ schrieb Thomas Brand <to...@tr...>:
>>> Eventually a "seek_compatibility" flag could be introduced.
>>
>> This would need to be opt-in, though. We could introduce a flag
>> to fix SEEK_END behaviour. Or we could just document the state as-is
>> and realize that it's a rare case with not much practical impact.
>>
>it's a hard decision. i don't know what's the best future-proof approach here.
>opt-in sounds good, plus documentation ..
>> Hm. Returning an error or silently (only by return value) limiting offset
>> to the end. Both may make sense.
I think it's simple after all. In a read-write library, seeking beyond
the end makes sense. You can write there and enlarge the file.
In a read-only library, only positions within the file make sense.
Current mpg123 inverts the sign of an offset from SEEK_END,
as I thought back then that it would be obvious to mean positive
steps from the end back. Only one direction does make sense.
So, what's the problem if I'd just ignore the sign of the SEEK_END
argument?
mpg123_seek(mh, 128, SEEK_END)
mpg123_seek(mh, -128, SEEK_END)
could both do the same thing. The latter would've been a error
with current libmpg123. Turning errors into valid behaviour has
its risks, but in this case, I think it is sensible.
Alrighty then,
Thomas
|