History

avcodec/dxva2(h264|mpeg2|vc1): use av_assert0 instead of assert

Tong Wu committed 2 years ago

Commit 270cd141 parent 0f015814 files · +12 −12Browse files

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

Unified · Split

4 files
  1. libavcodec/dxva2.c +2 −2
  2. libavcodec/dxva2_h264.c +8 −8
  3. libavcodec/dxva2_mpeg2.c +1 −1
  4. libavcodec/dxva2_vc1.c +1 −1
libavcodec/dxva2.c+2−2
@@ -20,10 +20,10 @@ · 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
26+#include "libavutil/avassert.h"
2727 #include "libavutil/common.h"
2828 #include "libavutil/log.h"
2929 #include "libavutil/time.h"
@@ -1012,7 +1012,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame, · 982 unmodified lines
10121012
10131013 /* TODO Film Grain when possible */
10141014
1015− assert(buffer_count == 1 + (qm_size > 0) + 2);
1015+ av_assert0(buffer_count == 1 + (qm_size > 0) + 2);
10161016
10171017 #if CONFIG_D3D11VA
10181018 if (ff_dxva2_is_d3d11(avctx))
libavcodec/dxva2_h264.c+8−8
@@ -44,7 +44,7 @@ struct dxva2_picture_context { · 43 unmodified lines
4444 static void fill_picture_entry(DXVA_PicEntry_H264 *pic,
4545 unsigned index, unsigned flag)
4646 {
47− assert((index&0x7f) == index && (flag&0x01) == flag);
47+ av_assert0((index&0x7f) == index && (flag&0x01) == flag);
4848 pic->bPicEntry = index | (flag << 7);
4949 }
5050
@@ -194,8 +194,8 @@ void ff_dxva2_h264_fill_scaling_lists(const AVCodecContext *avctx, AVDXVAContext · 143 unmodified lines
194194
195195 static int is_slice_short(const AVCodecContext *avctx, AVDXVAContext *ctx)
196196 {
197− assert(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 ||
198− DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2);
197+ av_assert0(DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 1 ||
198+ DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2);
199199 return DXVA_CONTEXT_CFG_BITSTREAM(avctx, ctx) == 2;
200200 }
201201
@@ -348,10 +348,10 @@ static int commit_bitstream_and_slice_buffer(AVCodecContext *avctx, · 146 unmodified lines
348348 static const unsigned start_code_size = sizeof(start_code);
349349 unsigned position, size;
350350
351− assert(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) ==
352− offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation));
353− assert(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) ==
354− offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer));
351+ av_assert0(offsetof(DXVA_Slice_H264_Short, BSNALunitDataLocation) ==
352+ offsetof(DXVA_Slice_H264_Long, BSNALunitDataLocation));
353+ av_assert0(offsetof(DXVA_Slice_H264_Short, SliceBytesInBuffer) ==
354+ offsetof(DXVA_Slice_H264_Long, SliceBytesInBuffer));
355355
356356 if (is_slice_short(avctx, ctx))
357357 slice = &ctx_pic->slice_short[i];
@@ -453,7 +453,7 @@ static int dxva2_h264_start_frame(AVCodecContext *avctx, · 95 unmodified lines
453453
454454 if (!DXVA_CONTEXT_VALID(avctx, ctx))
455455 return -1;
456− assert(ctx_pic);
456+ av_assert0(ctx_pic);
457457
458458 /* Fill up DXVA_PicParams_H264 */
459459 ff_dxva2_h264_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);
libavcodec/dxva2_mpeg2.c+1−1
@@ -264,7 +264,7 @@ static int dxva2_mpeg2_start_frame(AVCodecContext *avctx, · 263 unmodified lines
264264
265265 if (!DXVA_CONTEXT_VALID(avctx, ctx))
266266 return -1;
267− assert(ctx_pic);
267+ av_assert0(ctx_pic);
268268
269269 ff_dxva2_mpeg2_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);
270270 ff_dxva2_mpeg2_fill_quantization_matrices(avctx, ctx, &ctx_pic->qm);
libavcodec/dxva2_vc1.c+1−1
@@ -321,7 +321,7 @@ static int dxva2_vc1_start_frame(AVCodecContext *avctx, · 320 unmodified lines
321321
322322 if (!DXVA_CONTEXT_VALID(avctx, ctx))
323323 return -1;
324− assert(ctx_pic);
324+ av_assert0(ctx_pic);
325325
326326 ff_dxva2_vc1_fill_picture_parameters(avctx, ctx, &ctx_pic->pp);
327327

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