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

Submitted by Matthieu Bouron on Sept. 6, 2019, 1:57 p.m.

Details

Message ID 20190906135758.14768-1-matthieu.bouron@gmail.com
State New
Headers show

Commit Message

Matthieu Bouron Sept. 6, 2019, 1:57 p.m.
---
 libavcodec/mediacodecdec_common.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Patch hide | download patch | download mbox

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;
     }