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>
This commit is contained in:
Tong Wu 2023-12-28 11:10:41 +08:00 committed by Haihao Xiang
parent 56c671c3b0
commit 0f01581ccd
2 changed files with 2 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;
}