aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/libx264.c
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2015-10-03 12:46:01 +0200
committerHendrik Leppkes <h.leppkes@gmail.com>2015-10-03 12:46:01 +0200
commitcda503a1b92c776cd197ec5a8879b793d9deaad8 (patch)
tree5c26ee821fbfa6a48aa09b1197174b173eea7f30 /libavcodec/libx264.c
parentf5af92edb9218ead9008db5f59bd9aa39e645539 (diff)
parent380146924ecad2e05e9dcc5c3c2e1b5ba47c51e8 (diff)
downloadffmpeg-cda503a1b92c776cd197ec5a8879b793d9deaad8.tar.gz
Merge commit '380146924ecad2e05e9dcc5c3c2e1b5ba47c51e8'
* commit '380146924ecad2e05e9dcc5c3c2e1b5ba47c51e8': x264: Add option to force IDR frames Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavcodec/libx264.c')
-rw-r--r--libavcodec/libx264.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index 58fcfb0eed..7f019cf64d 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -270,13 +270,22 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
}
x4->pic.i_pts = frame->pts;
- x4->pic.i_type =
- frame->pict_type == AV_PICTURE_TYPE_I ?
- (x4->forced_idr >= 0 ? X264_TYPE_IDR : X264_TYPE_KEYFRAME) :
- frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
- frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
- X264_TYPE_AUTO;
+ switch (frame->pict_type) {
+ case AV_PICTURE_TYPE_I:
+ 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;
+ break;
+ case AV_PICTURE_TYPE_B:
+ x4->pic.i_type = X264_TYPE_B;
+ break;
+ default:
+ x4->pic.i_type = X264_TYPE_AUTO;
+ break;
+ }
reconfig_encoder(ctx, frame);
}
do {