comparison libx264.c @ 11748:40911dc14bdc libavcodec

fix x264 encoding when delay is > number of input frames
author bcoudurier
date Wed, 19 May 2010 20:48:29 +0000
parents 2312dfbe9251
children 22c2450cd00b
comparison
equal deleted inserted replaced
11747:3a150ee29655 11748:40911dc14bdc
100 100
101 x4->pic.i_pts = frame->pts; 101 x4->pic.i_pts = frame->pts;
102 x4->pic.i_type = X264_TYPE_AUTO; 102 x4->pic.i_type = X264_TYPE_AUTO;
103 } 103 }
104 104
105 do {
105 if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0) 106 if (x264_encoder_encode(x4->enc, &nal, &nnal, frame? &x4->pic: NULL, &pic_out) < 0)
106 return -1; 107 return -1;
107 108
108 bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0); 109 bufsize = encode_nals(ctx, buf, bufsize, nal, nnal, 0);
109 if (bufsize < 0) 110 if (bufsize < 0)
110 return -1; 111 return -1;
112 } while (!bufsize && !frame && x264_encoder_delayed_frames(x4->enc));
111 113
112 /* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */ 114 /* FIXME: libx264 now provides DTS, but AVFrame doesn't have a field for it. */
113 x4->out_pic.pts = pic_out.i_pts; 115 x4->out_pic.pts = pic_out.i_pts;
114 116
115 switch (pic_out.i_type) { 117 switch (pic_out.i_type) {