OSDN Git Service

lavc: allow asynchronous decoders to return correct pkt_dts values
authorwm4 <nfxjfg@googlemail.com>
Fri, 11 Sep 2015 16:36:56 +0000 (18:36 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 12 Sep 2015 10:27:19 +0000 (12:27 +0200)
commit87a051f97633010f71dfc1d23d806856499bf231
tree6398a5fa15f96cb3b5130ae1f1da2fb7ddc544b1
parentb7ab6e18eecad43593ad2a0e9fc9eba7f24751cb
lavc: allow asynchronous decoders to return correct pkt_dts values

The generic code in utils.c sets the AVFrame.pkt_dts field from the
packet it was supposedly decoded. This does not have to be true for a
fully asynchronous decoder like mmaldec. It could be overwritten with an
incorrect value. Even if the decoder doesn't determine the DTS (but sets
it to AV_NOPTS_VALUE), it's impossible to determine a correct value in
utils.c.

Decoders can now be marked with FF_CODEC_CAP_SETS_PKT_DTS, in which case
utils.c won't overwrite the field. The decoders are expected to set this
field (even if they only set it to AV_NOPTS_VALUE).

Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
libavcodec/internal.h
libavcodec/mmaldec.c
libavcodec/utils.c