flvdec: Export new AAC/H.264 extradata as side data on the next packet
authorMartin Storsjö <martin@martin.st>
Thu, 15 Dec 2011 14:29:55 +0000 (16:29 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 21 Dec 2011 20:52:38 +0000 (22:52 +0200)
commit251f320f7deeae22d25c013fb29d162517dd3c91
treef9ec4fb81df1cb7e998c0bc51a7be4f884dffbbd
parent195c123cc87bb46efbadb48b2f756ae49bdb6774
flvdec: Export new AAC/H.264 extradata as side data on the next packet

Compared to just overwriting the old extradata, this has the
advantage of letting the decoder know exactly when the
extradata changed (otherwise it is changed immediately when the
new extradata packet is demuxed, even if there's old queued packets
awaiting to be decoded). This makes it easier for decoders to
actually react to the change, so they won't have to inspect
the extradata for each packet to see if it might have changed.

This works when sequentially playing a file with sample rate
changes, but if seeking past a new extradata packet in the
file, it obviously doesn't work properly. That case doesn't
work in flash player either, so it's probably ok not to handle
it.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/flvdec.c