From: Tong Wu <tong1.wu-at-intel.com@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: Tong Wu <tong1.wu@intel.com> Subject: [FFmpeg-devel] [PATCH v2 4/5] avcodec/d3d12va_decode|dxva2: add a warning to replace assertion Date: Thu, 28 Dec 2023 11:10:41 +0800 Message-ID: <20231228031042.1129-4-tong1.wu@intel.com> (raw) In-Reply-To: <20231228031042.1129-1-tong1.wu@intel.com> Previous assertion was not useful. Now a warning is added to replace it. For get_surface_index, we should return a zero index in case the index is not found. But a warning is necessary to notify. Signed-off-by: Tong Wu <tong1.wu@intel.com> --- libavcodec/d3d12va_decode.c | 3 +-- libavcodec/dxva2.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libavcodec/d3d12va_decode.c b/libavcodec/d3d12va_decode.c index 50d5b8d601..babb2aaa0f 100644 --- a/libavcodec/d3d12va_decode.c +++ b/libavcodec/d3d12va_decode.c @@ -20,7 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include <assert.h> #include <string.h> #include <initguid.h> @@ -80,7 +79,7 @@ unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx, } fail: - assert(0); + av_log(avctx, AV_LOG_WARNING, "Could not get surface index. Using 0 instead.\n"); return 0; } diff --git a/libavcodec/dxva2.c b/libavcodec/dxva2.c index 7160a0008b..a6ad5e4dc7 100644 --- a/libavcodec/dxva2.c +++ b/libavcodec/dxva2.c @@ -795,7 +795,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, } #endif - assert(0); + av_log(avctx, AV_LOG_WARNING, "Could not get surface index. Using 0 instead.\n"); return 0; } -- 2.41.0.windows.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 prev parent reply other threads:[~2023-12-28 3:12 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-28 3:10 [FFmpeg-devel] [PATCH v2 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Tong Wu 2023-12-28 3:10 ` [FFmpeg-devel] [PATCH v2 2/5] avcodec/d3d12va_decode: delete an empty line and fix a fuction alignment Tong Wu 2023-12-28 3:10 ` [FFmpeg-devel] [PATCH v2 3/5] avcodec/d3d12va_h264: replace assert with av_assert0 Tong Wu 2023-12-28 3:10 ` Tong Wu [this message] 2023-12-28 3:10 ` [FFmpeg-devel] [PATCH v2 5/5] avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert Tong Wu 2024-01-02 5:21 ` [FFmpeg-devel] [PATCH v2 1/5] avcodec/d3d12va_vp9: fix vp9 max_num_refs value Xiang, Haihao 2024-01-05 3:56 ` 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=20231228031042.1129-4-tong1.wu@intel.com \ --to=tong1.wu-at-intel.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ --cc=tong1.wu@intel.com \ /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