[MPlayer-dev-eng] [PATCH 1/2] vd_ffmpeg: do not spam in case of codecs we are parsing.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Tue Jul 12 00:28:49 EEST 2022


If we parse them we assume the codec to consume the
frame completely, and we are not able to rewind.
Disable the corresponding checks.
This applies to native demuxers, lavf demuxers
will not have needs_parsing set.
---
 libmpcodecs/vd_ffmpeg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c
index 6e30c51f6..37f9317a8 100644
--- a/libmpcodecs/vd_ffmpeg.c
+++ b/libmpcodecs/vd_ffmpeg.c
@@ -925,11 +925,11 @@ static mp_image_t *decode(sh_video_t *sh, void *data, int len, int flags){
         }
         ctx->palette_sent = 1;
     }
-    if (sh->ds->buffer_pos < len)
+    if (!sh->needs_parsing && 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)) {
-        if (sh->ds->buffer_pos >= len) sh->ds->buffer_pos -= len;
+        if (!sh->needs_parsing && sh->ds->buffer_pos >= len) sh->ds->buffer_pos -= len;
         ret = 0;
     }
     if (ret >= 0 || ret == AVERROR_EOF) {
-- 
2.36.1



More information about the MPlayer-dev-eng mailing list