[MPlayer-cvslog] r38218 - trunk/libmpcodecs/vd_ffmpeg.c

reimar subversion at mplayerhq.hu
Wed Jan 20 20:03:27 EET 2021


Author: reimar
Date: Wed Jan 20 20:03:27 2021
New Revision: 38218

Log:
vd_ffmpeg: support receiving multiple frames in a row.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Wed Jan 20 20:03:26 2021	(r38217)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Wed Jan 20 20:03:27 2021	(r38218)
@@ -925,9 +925,11 @@ static mp_image_t *decode(sh_video_t *sh
         }
         ctx->palette_sent = 1;
     }
+    if (sh->ds->buffer_pos < len)
+        mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Bad stream state, please report as bug!\n");
     ret = avcodec_send_packet(avctx, !pkt.data && !pkt.size ? NULL : &pkt);
     if (ret == AVERROR(EAGAIN)) {
-        mp_msg(MSGT_DECVIDEO, MSGL_ERR, "Too many frames buffered in decode, MPlayer cannot handle that yet!\n");
+        if (sh->ds->buffer_pos >= len) sh->ds->buffer_pos -= len;
         ret = 0;
     }
     if (ret >= 0 || ret == AVERROR_EOF) {


More information about the MPlayer-cvslog mailing list