Commit f5e33514 authored by Limin Wang's avatar Limin Wang

avcodec/libx264: return immediately if encode_nals return 0

x264_encoder_encode can return 0 with nnal 0. As a result, encode_nals will
return 0. In this condition, it's better to return 0 immediately to avoid
the following unneeded pict_type and flags setting.
Signed-off-by: 's avatarLimin Wang <lance.lmwang@gmail.com>
parent d8e98d93
......@@ -447,6 +447,9 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
return ret;
} while (!ret && !frame && x264_encoder_delayed_frames(x4->enc));
if (!ret)
return 0;
pkt->pts = pic_out.i_pts;
pkt->dts = pic_out.i_dts;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment