[FFmpeg-devel] [PATCH] avcodec/libx264: fix forced_idr logic

Timo Rothenpieler timo at rothenpieler.org
Wed Oct 12 22:57:16 EEST 2016


Currently, it forces IDR frames for both true and false.
Not entirely sure what the original idea behind the tri-state bool
option is.
---
 libavcodec/libx264.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 9e12464..32e767e 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -293,8 +293,8 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
 
         switch (frame->pict_type) {
         case AV_PICTURE_TYPE_I:
-            x4->pic.i_type = x4->forced_idr >= 0 ? X264_TYPE_IDR
-                                                 : X264_TYPE_KEYFRAME;
+            x4->pic.i_type = x4->forced_idr > 0 ? X264_TYPE_IDR
+                                                : X264_TYPE_KEYFRAME;
             break;
         case AV_PICTURE_TYPE_P:
             x4->pic.i_type = X264_TYPE_P;
-- 
2.10.1



More information about the ffmpeg-devel mailing list