From e5d3894bc48ae28d5eb386e1a8438091c3de0b8f Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 29 Jan 2012 19:10:58 +0100 Subject: [PATCH] Check for AV_NOPTS_VALUE. --- record/ffemu.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/record/ffemu.c b/record/ffemu.c index 38cb0946c6..4ea6dbc557 100644 --- a/record/ffemu.c +++ b/record/ffemu.c @@ -545,8 +545,13 @@ static bool ffemu_push_video_thread(ffemu_t *handle, const struct ffemu_video_da pkt.data = handle->video.outbuf; pkt.size = outsize; - pkt.pts = av_rescale_q(handle->video.codec->coded_frame->pts, handle->video.codec->time_base, - handle->muxer.vstream->time_base); + if (handle->video.codec->coded_frame->pts != AV_NOPTS_VALUE) + { + pkt.pts = av_rescale_q(handle->video.codec->coded_frame->pts, handle->video.codec->time_base, + handle->muxer.vstream->time_base); + } + else + pkt.pts = AV_NOPTS_VALUE; if (handle->video.codec->coded_frame->key_frame) pkt.flags |= AV_PKT_FLAG_KEY;