History

avcodec/libvpxenc: Avoid unused-variable warning if VP9 enc is disabled

Andreas Rheinhardt committed 2 years ago

Commit a5fcd971 parent e1232951 file · +4 −3Browse files

Unified · Split

libavcodec/libvpxenc.c+4−3
@@ -49,6 +49,9 @@ · 48 unmodified lines
4949 #include "libavutil/opt.h"
5050 #include "libavutil/pixdesc.h"
5151
52+#define IS_VP9(avctx) (CONFIG_LIBVPX_VP9_ENCODER && avctx->codec_id == AV_CODEC_ID_VP9)
53+#define IS_VP8(avctx) (CONFIG_LIBVPX_VP8_ENCODER && avctx->codec_id == AV_CODEC_ID_VP8)
54+
5255 /**
5356 * Portion of struct vpx_codec_cx_pkt from vpx_encoder.h.
5457 * One encoded frame returned from the library.
@@ -359,8 +362,7 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo, · 304 unmodified lines
359362 FrameData fd = { .pts = frame->pts };
360363 int ret;
361364
362−#if CONFIG_LIBVPX_VP9_ENCODER
363− if (avctx->codec_id == AV_CODEC_ID_VP9 &&
365+ if (IS_VP9(avctx) &&
364366 // Keep HDR10+ if it has bit depth higher than 8 and
365367 // it has PQ trc (SMPTE2084).
366368 enccfg->g_bit_depth > 8 && avctx->color_trc == AVCOL_TRC_SMPTE2084) {
@@ -372,7 +374,6 @@ static int frame_data_submit(AVCodecContext *avctx, AVFifo *fifo, · 5 unmodified lines
372374 return AVERROR(ENOMEM);
373375 }
374376 }
375−#endif
376377
377378 fd.duration = frame->duration;
378379 fd.frame_opaque = frame->opaque;

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