summaryrefslogtreecommitdiff
path: root/libavcodec/internal.h
diff options
context:
space:
mode:
authorwm4 <nfxjfg@googlemail.com>2015-09-11 18:36:56 +0200
committerLuca Barbato <lu_zero@gentoo.org>2015-09-12 12:27:19 +0200
commit87a051f97633010f71dfc1d23d806856499bf231 (patch)
tree6398a5fa15f96cb3b5130ae1f1da2fb7ddc544b1 /libavcodec/internal.h
parentb7ab6e18eecad43593ad2a0e9fc9eba7f24751cb (diff)
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>
Diffstat (limited to 'libavcodec/internal.h')
-rw-r--r--libavcodec/internal.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/internal.h b/libavcodec/internal.h
index fc906322f8..500511dada 100644
--- a/libavcodec/internal.h
+++ b/libavcodec/internal.h
@@ -46,7 +46,13 @@
* all.
*/
#define FF_CODEC_CAP_INIT_CLEANUP (1 << 1)
-
+/**
+ * Decoders marked with FF_CODEC_CAP_SETS_PKT_DTS want to set
+ * AVFrame.pkt_dts manually. If the flag is set, utils.c won't overwrite
+ * this field. If it's unset, utils.c tries to guess the pkt_dts field
+ * from the input AVPacket.
+ */
+#define FF_CODEC_CAP_SETS_PKT_DTS (1 << 2)
#ifdef DEBUG
# define ff_dlog(ctx, ...) av_log(ctx, AV_LOG_DEBUG, __VA_ARGS__)