[opus] Question about libopusfile downloading the last 64K when duration is not needed

Timothy B. Terriberry tterribe at xiph.org
Thu Nov 15 07:16:39 UTC 2018


Ian Reed wrote:
> It explains why libopusfile requires the last 64K to calculate the 
> duration, but again, I don't need libopusfile to get the duration for 
> me, I only want it to allow me to seek within parts of the file that 
> have already been downloaded.

Unfortunately, this is not currently supported.

> Is there a reason libopusfile forces the retrieval of the last 64K of 
> the file when seeking is enabled, but without ever being asked for the 
> duration?

It makes the code substantially simpler to be able to enumerate the 
tracks, chain boundaries, etc., of the file once in advance. All of the 
seeking code assumes this enumeration has been done. It might be 
possible to remove this limitation and still enable some functionality 
that is not available for an unseekable stream, but I have not tried, 
and I expect it would be a lot of work.


More information about the opus mailing list