[FFmpeg-devel] [PATCH 1/2] avcodec/mediacodecdec_common: simplify ff_mediacodec_dec_send()

Matthieu Bouron matthieu.bouron at gmail.com
Fri Sep 6 16:57:57 EEST 2019


---
 libavcodec/mediacodecdec_common.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/libavcodec/mediacodecdec_common.c b/libavcodec/mediacodecdec_common.c
index 1656cd6664..6c0a1212c1 100644
--- a/libavcodec/mediacodecdec_common.c
+++ b/libavcodec/mediacodecdec_common.c
@@ -567,7 +567,7 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
                            AVPacket *pkt, bool wait)
 {
     int offset = 0;
-    int need_draining = 0;
+    int need_draining = pkt->size == 0;
     uint8_t *data;
     ssize_t index = s->current_input_buffer;
     size_t size;
@@ -582,10 +582,6 @@ int ff_mediacodec_dec_send(AVCodecContext *avctx, MediaCodecDecContext *s,
         return AVERROR_EXTERNAL;
     }
 
-    if (pkt->size == 0) {
-        need_draining = 1;
-    }
-
     if (s->draining && s->eos) {
         return AVERROR_EOF;
     }
-- 
2.23.0



More information about the ffmpeg-devel mailing list