diff mbox series

[FFmpeg-devel,04/11] avcodec/encode: Simplify check for frame-threaded encoder

Message ID DB6PR0101MB221462993E9E44D8279E82918F739@DB6PR0101MB2214.eurprd01.prod.exchangelabs.com
State Accepted
Commit 312d4467f379d34257f60aeb7ad88fb29b11caeb
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:39 a.m. UTC
AVCodecInternal.frame_thread_encoder is only set iff
active_thread_type is FF_THREAD_FRAME.

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

Patch

diff --git a/libavcodec/encode.c b/libavcodec/encode.c
index 9f413095e4..01b59bbf70 100644
--- a/libavcodec/encode.c
+++ b/libavcodec/encode.c
@@ -192,7 +192,7 @@  static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
 
     if (!frame->buf[0]) {
         if (!(avctx->codec->capabilities & AV_CODEC_CAP_DELAY ||
-              (avci->frame_thread_encoder && avctx->active_thread_type & FF_THREAD_FRAME)))
+              avci->frame_thread_encoder))
             return AVERROR_EOF;
 
         // Flushing is signaled with a NULL frame
@@ -203,8 +203,7 @@  static int encode_simple_internal(AVCodecContext *avctx, AVPacket *avpkt)
 
     av_assert0(codec->cb_type == FF_CODEC_CB_TYPE_ENCODE);
 
-    if (CONFIG_FRAME_THREAD_ENCODER &&
-        avci->frame_thread_encoder && (avctx->active_thread_type & FF_THREAD_FRAME))
+    if (CONFIG_FRAME_THREAD_ENCODER && avci->frame_thread_encoder)
         /* This might modify frame, but it doesn't matter, because
          * the frame properties used below are not used for video
          * (due to the delay inherent in frame threaded encoding, it makes