History

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.

Tong Wu committed 2 years ago

Commit 0f015811 parent 56c671c2 files · +2 −3Browse files

Unified · Split

2 files
  1. libavcodec/d3d12va_decode.c +1 −2
  2. libavcodec/dxva2.c +1 −1
libavcodec/d3d12va_decode.c+1−2
@@ -20,7 +20,6 @@ · 19 unmodified lines
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */21 */
22 22
23#include <assert.h>
24#include <string.h>23#include <string.h>
25#include <initguid.h>24#include <initguid.h>
26 25
@@ -80,7 +79,7 @@ unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx, · 53 unmodified lines
80 }79 }
81 80
82fail:81fail:
83 assert(0);82 av_log(avctx, AV_LOG_WARNING, "Could not get surface index. Using 0 instead.\n");
84 return 0;83 return 0;
85}84}
86 85
libavcodec/dxva2.c+1−1
@@ -795,7 +795,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, · 794 unmodified lines
795 }795 }
796#endif796#endif
797 797
798 assert(0);798 av_log(avctx, AV_LOG_WARNING, "Could not get surface index. Using 0 instead.\n");
799 return 0;799 return 0;
800}800}
801 801

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t