[vlc-devel] [PATCH 2/2] avcodec: initialize buffers when first frame comes in

Ilkka Ollakka ileoo at videolan.org
Fri Sep 20 15:40:18 CEST 2013

On Fri, Sep 20, 2013 at 11:04:28AM +0200, Rémi Denis-Courmont wrote:
> Currently, the transcode plugin does not seem to handle correctly the case
> whereby the output format of an audio decoder changes. It just assumes the
> audio format is set by the decoder in pf_activate() and never changes. Both
> of those assumptions are of course wrong.

Yes you are right. I'm planning to implement similar format check that
video side does currently (if format changes, reinit filter chain).

> Tweaking the avcodec encoder will not really solve the problem. Filters
> will still break, other encoder plugins will still break, and even avcodec
> will still break if the audio format changes dynamically.

It doesn't, but as avcodec is mostly used and it uses given
i_channels for buffer allocation, I tought it would be better to
allocate those buffers in place where we always should have non-zero
channel count.

But it could be better just to implement that format change check in
transcoder at first and then make sure in avcodec-module that we have
buffers if we need them.

Ilkka Ollakka
"We all know Linux is great...it does infinite loops in 5 seconds."
(Linus Torvalds about the superiority of Linux on the Amsterdam
Linux Symposium)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20130920/07dfabac/attachment.sig>

More information about the vlc-devel mailing list