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

reimar subversion at mplayerhq.hu
Sun Aug 7 21:20:47 EEST 2022


Author: reimar
Date: Sun Aug  7 21:20:47 2022
New Revision: 38372

Log:
vd_ffmpeg: do not spam in case of codecs we are parsing.

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.

Modified:
   trunk/libmpcodecs/vd_ffmpeg.c

Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c	Sun Aug  7 21:20:46 2022	(r38371)
+++ trunk/libmpcodecs/vd_ffmpeg.c	Sun Aug  7 21:20:47 2022	(r38372)
@@ -925,11 +925,11 @@ static mp_image_t *decode(sh_video_t *sh
         }
         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) {


More information about the MPlayer-cvslog mailing list