[FFmpeg-devel] [PATCH 1/8] lavf: add internal demuxer helpers for subtitles.

Nicolas George nicolas.george at normalesup.org
Fri Jun 22 13:31:22 CEST 2012

Le quartidi 4 messidor, an CCXX, Clément Bœsch a écrit :
> Sane strings, mainly to simplify debug purpose ("did I insert the string
> correctly in the queue? let's print it.").

IMHO, the best course of action in such a case is to handle it as binary
data _and_ ensure that there is an additional NUL byte after.

> It greatly simplifies the decoders to do so... I think if I actually
> drop the explicit NUL insert, it would work exactly the same because of
> the FF_INPUT_BUFFER_PADDING_SIZE filled with zeros.

... and as you say, it is in fact already the case.

> Mmh indeed, re-thinking of this it should indeed works with binary too. It
> was designed for text purpose in mind though. I could add some debug
> function call printing the event in it for instance.

Having debug functions that only work for ASCII-like text is not a problem.

> OTOH, I'm not that blind and I realize a few persons here believe it would
> be better to make them generic, using AVPacket, changing naming to work
> with any abstract packet data etc. If you guys think the memory usage and
> the other arguments are not worth creating that interface, I may take the
> time this week end to rework the patchset.

IMHO, if the memory usage were a major factor, there would be much more
urgent to optimize, such as not allocating one buffer per packet.

The major point I see in favor for using AVPacket is that it does not
require to learn a new structure, with different field names, etc.


  Nicolas George

More information about the ffmpeg-devel mailing list