[vlc-devel] Matroska, libopus and loophole in the spec

Timothy B. Terriberry tterribe at xiph.org
Mon Nov 11 17:48:09 CET 2013

Denis Charmet wrote:
> 1. Change the Opus in matroska muxing spec to make duration of blocks
> mandatory so we can calculate the number of samples, which is overkill.

I agree this is silly when the information is already in the packets 

> 2. Wait for the next audio packet to determine the previous one's
> duration which is even worse, since you cannot do that for the last
> packet and if you have a lace of several audio packet you could
> theoretically wait for a long time between two actual packets which
> could cause audio gaps.

This is equally unnecessary.

> The alternative is to change the Opus codec plugin to use the number of
> samples of the packet if it isn't known at the demux level instead of
> just dropping it. As proposed in the patch sent yesterday.

I don't think this will be enough once you want to support pre-skip, 
pre-roll, and end-trimming correctly. That's why this logic lives in the 
demux for Ogg. Feel free to try doing those things and prove me wrong, 

> As previously stated, I'm against linking the demux to a codec lib just
> to fill a block_t field that could easily be ignored and to call
> functions that will be called in the codec anyway for the same purpose.

That's why the Ogg demux doesn't link to the codec lib. It just 
re-implements the duration calculation (see Ogg_OpusPacketDuration()).

More information about the vlc-devel mailing list