summaryrefslogtreecommitdiff
path: root/libavcodec/mediacodecdec_common.c
diff options
context:
space:
mode:
authorAman Gupta <aman@tmm1.net>2018-04-23 19:21:19 -0700
committerAman Gupta <aman@tmm1.net>2018-04-25 10:53:52 -0700
commit6a7a84b2d11e6c5e2ca2023a6886ca75b8b10030 (patch)
tree61bf67ae6e608e81194f9aae537c64e9459019ef /libavcodec/mediacodecdec_common.c
parentb2570afde3623ef2806b82f1d4e7428283b32491 (diff)
avcodec/mediacodecdec: clarify delay_flush specific code
As of 2a0eb8685, ff_mediacodec_dec_is_flushing() only returns true in delay_flush mode. Make this more obvious by adding delay_flush to the if statement. Signed-off-by: Matthieu Bouron <matthieu.bouron@gmail.com> Signed-off-by: Aman Gupta <aman@tmm1.net>
Diffstat (limited to 'libavcodec/mediacodecdec_common.c')
-rw-r--r--libavcodec/mediacodecdec_common.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c
index e59cf19aad..0c27624dea 100644
--- a/libavcodec/mediacodecdec_common.c
+++ b/libavcodec/mediacodecdec_common.c
@@ -764,6 +764,18 @@ int ff_mediacodec_dec_receive(AVCodecContext *avctx, MediaCodecDecContext *s,
return AVERROR(EAGAIN);
}
+/*
+* ff_mediacodec_dec_flush returns 0 if the flush cannot be performed on
+* the codec (because the user retains frames). The codec stays in the
+* flushing state.
+*
+* ff_mediacodec_dec_flush returns 1 if the flush can actually be
+* performed on the codec. The codec leaves the flushing state and can
+* process again packets.
+*
+* ff_mediacodec_dec_flush returns a negative value if an error has
+* occurred.
+*/
int ff_mediacodec_dec_flush(AVCodecContext *avctx, MediaCodecDecContext *s)
{
if (!s->surface || atomic_load(&s->refcount) == 1) {