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.
Showing the changes to libavcodec (2 of 2 files). Show all
Unified · Split
| @@ -20,7 +20,6 @@ · 19 unmodified lines | |||
| 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 20 | * 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 | ||
| 82 | fail: | 81 | fail: |
| 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 | ||
| @@ -795,7 +795,7 @@ unsigned ff_dxva2_get_surface_index(const AVCodecContext *avctx, · 794 unmodified lines | |||
| 795 | } | 795 | } |
| 796 | #endif | 796 | #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 | ||