Reconfiguring can break x264 lossless encoding.
Fixes ticket #2165.
(cherry picked from commit 75c7e4583f4fd727d236a12763a265502fe00988)
... | ... |
@@ -174,7 +174,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame, |
174 | 174 |
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P : |
175 | 175 |
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B : |
176 | 176 |
X264_TYPE_AUTO; |
177 |
- if (x4->params.b_tff != frame->top_field_first) { |
|
177 |
+ if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) { |
|
178 | 178 |
x4->params.b_tff = frame->top_field_first; |
179 | 179 |
x264_encoder_reconfig(x4->enc, &x4->params); |
180 | 180 |
} |