Re: [mpg123-devel] Notion of SEEK_END
Brought to you by:
sobukus
From: Thomas O. <tho...@or...> - 2023-08-30 02:50:29
|
Am Tue, 29 Aug 2023 17:21:23 +0000 schrieb Thomas Brand <to...@tr...>: > To seek 10 samples before the end, I'd seek(-10, SEEK_END), but this > overshoots by 10 samples (length + 10). On the other hand, seek(10, > SEEK_END) will go to 10 samples before the end. I think this notion is > inverse to other uses of SEEK_END. Oh, great. Looking at lseek(2) and at my own documentation in mpg123.h, the behaviour indeed does not match the description. It's utterly wrong and you are the first person to notice. Damn. I have to think hard on how to best handle it. Just correcting the behaviour would break anyone relying on the existing. At the same time, precisely because you're the first one noticing, I _guess_ that you might be the only one trying to seek from the end on MPEG files so far. Having the reverse meaning compared to lseek really sucks. I don't have the solution right now for the next release, just a confirmation that you're right. Alrighty then, Thomas |