From: Ting Hu <siriushu@hotmail.com> To: ffmpeg-devel@ffmpeg.org Cc: tinghu3 <siriushu@hotmail.com> Subject: [FFmpeg-devel] [PATCH v1 1/1] lavc/qsvdec: fix dead loop of qsv decoding Date: Thu, 17 Aug 2023 19:39:42 +0800 Message-ID: <OSZP286MB2142190D9FF8601673360B2AD51AA@OSZP286MB2142.JPNP286.PROD.OUTLOOK.COM> (raw) From: tinghu3 <siriushu@hotmail.com> MFXVideoDECODE_DecodeFrameAsync always return MFX_WRN_DEVICE_BUSY in special scenario. Signed-off-by: tinghu3 <siriushu@hotmail.com> --- libavcodec/qsvdec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libavcodec/qsvdec.c b/libavcodec/qsvdec.c index da700f25e9..35102fb476 100644 --- a/libavcodec/qsvdec.c +++ b/libavcodec/qsvdec.c @@ -703,6 +703,7 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, mfxSyncPoint *sync; mfxBitstream bs = { { { 0 } } }; int ret; + int max_count = 0; if (avpkt->size) { bs.Data = avpkt->data; @@ -730,7 +731,9 @@ static int qsv_decode(AVCodecContext *avctx, QSVContext *q, insurf, &outsurf, sync); if (ret == MFX_WRN_DEVICE_BUSY) av_usleep(500); - + /* Check the max wait time 500ms to avoid dead loop */ + if (++max_count == 1000) + return ret; } while (ret == MFX_WRN_DEVICE_BUSY || ret == MFX_ERR_MORE_SURFACE); if (ret == MFX_ERR_INCOMPATIBLE_VIDEO_PARAM) { -- 2.38.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next reply other threads:[~2023-08-17 11:40 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-08-17 11:39 Ting Hu [this message] 2023-08-21 6:20 ` Xiang, Haihao
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=OSZP286MB2142190D9FF8601673360B2AD51AA@OSZP286MB2142.JPNP286.PROD.OUTLOOK.COM \ --to=siriushu@hotmail.com \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git