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

Showing the changes to libavcodec (2 of 2 files). Show all

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
2020 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2121 */
2222
23−#include <assert.h>
2423 #include <string.h>
2524 #include <initguid.h>
2625
@@ -80,7 +79,7 @@ unsigned ff_d3d12va_get_surface_index(const AVCodecContext *avctx, · 53 unmodified lines
8079 }
8180
8281 fail:
83− assert(0);
82+ av_log(avctx, AV_LOG_WARNING, "Could not get surface index. Using 0 instead.\n");
8483 return 0;
8584 }
8685
libavcodec/dxva2.c+1−1
@@ -795,7 +795,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, · 794 unmodified lines
795795 }
796796 #endif
797797
798− assert(0);
798+ av_log(avctx, AV_LOG_WARNING, "Could not get surface index. Using 0 instead.\n");
799799 return 0;
800800 }
801801

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