Browse Source

fix x264 encoding when delay is > number of input frames

Originally committed as revision 23197 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/n0.8
Baptiste Coudurier 15 years ago
parent
commit
d545fa56f1
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/libx264.c

+ 2
- 0
libavcodec/libx264.c View File

@@ -102,12 +102,14 @@ static int X264_frame(AVCodecContext *ctx, uint8_t *buf,
x4->pic.i_type = X264_TYPE_AUTO; x4->pic.i_type = X264_TYPE_AUTO;
} }


do {
if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0) if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
return -1; return -1;


bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0); bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0);
if (bufsize < 0) if (bufsize < 0)
return -1; return -1;
} while (!bufsize && !frame && x264_encoder_delayed_frames(x4->enc));


/* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */ /* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */
x4->out_pic.pts = pic_out.i_pts; x4->out_pic.pts = pic_out.i_pts;


Loading…
Cancel
Save