aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorTong Wu <tong1.wu-at-intel.com@ffmpeg.org>2023-12-28 11:10:41 +0800
committerHaihao Xiang <haihao.xiang@intel.com>2024-01-05 11:06:57 +0800
commit0f01581ccd757f14ec349eba5d19c19b158d5957 (patch)
treea29bbd84a6b3320c192ecf31b551b4f2d98fd9c5 /libavcodec
parent56c671c3b085d662a84a1e371a719ee63c315656 (diff)
downloadffmpeg-0f01581ccd757f14ec349eba5d19c19b158d5957.tar.gz
avcodec/d3d12va_decode|dxva2: add a warning to replace assertion
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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/d3d12va_decode.c3
-rw-r--r--libavcodec/dxva2.c2
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;
}