Browse Source

Merge commit '380146924ecad2e05e9dcc5c3c2e1b5ba47c51e8'

* commit '380146924ecad2e05e9dcc5c3c2e1b5ba47c51e8':
  x264: Add option to force IDR frames

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
tags/n3.0
Hendrik Leppkes 10 years ago
parent
commit
cda503a1b9
1 changed files with 15 additions and 6 deletions
  1. +15
    -6
      libavcodec/libx264.c

+ 15
- 6
libavcodec/libx264.c View File

@@ -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 {


Loading…
Cancel
Save