ffmpeg | branch: master | Rick Kern <ker...@gmail.com> | Wed Apr 27 10:53:09 2016 -0400| [2fbf39382dbf38e7cfdd2b106da66ca2f5af307d] | committer: wm4
lavc/videotoolboxenc: Fix DTS Some devices output an invalid DTS when B-frames aren't used. Using PTS for the DTS in this case. Signed-off-by: Rick Kern <ker...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2fbf39382dbf38e7cfdd2b106da66ca2f5af307d --- libavcodec/videotoolboxenc.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 25c9648..72c7ba8 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -1034,6 +1034,15 @@ static int vtenc_cm_to_avpacket( pts = CMSampleBufferGetPresentationTimeStamp(sample_buffer); dts = CMSampleBufferGetDecodeTimeStamp (sample_buffer); + if (CMTIME_IS_INVALID(dts)) { + if (!vtctx->has_b_frames) { + dts = pts; + } else { + av_log(avctx, AV_LOG_ERROR, "DTS is invalid.\n"); + return AVERROR_EXTERNAL; + } + } + dts_delta = vtctx->dts_delta >= 0 ? vtctx->dts_delta : 0; time_base_num = avctx->time_base.num; pkt->pts = pts.value / time_base_num; _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog