diff mbox series

[FFmpeg-devel,07/11] avcodec/encode: Remove redundant check

Message ID DB6PR0101MB22144AD0EDDCDD808D186AE48F739@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit 52dcf0e0f56b4a696ba134221c03facdc166c7fc
Headers show
Series [FFmpeg-devel,01/11] avcodec/tests/avcodec: Mark frame-thrd encoder incompatible with delay | expand

Commit Message

Andreas Rheinhardt Aug. 24, 2022, 1:40 a.m. UTC
frame is always set at this point for no-delay encoders.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/encode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index f7b13c8ba1..f66e2f9ba8 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -194,7 +194,7 @@  int ff_encode_encode_cb(AVCodecContext *avctx, AVPacket *avpkt,
         if (avctx->codec->type == AVMEDIA_TYPE_VIDEO &&
             !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY))
             avpkt->pts = avpkt->dts = frame->pts;
-        if (frame && !(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) {
+        if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY)) {
             if (avctx->codec->type == AVMEDIA_TYPE_AUDIO) {
                 if (avpkt->pts == AV_NOPTS_VALUE)
                     avpkt->pts = frame->pts;