obs-ffmpeg/ffmpeg-mux: Set codec->time_base if avformat < 59

This commit is contained in:
Maya Venkatraman 2020-10-13 09:14:14 -07:00 committed by jp9000
parent f7a468dd30
commit 04596ec097

View File

@ -387,6 +387,10 @@ static void create_video_stream(struct ffmpeg_mux *ffm)
(AVRational){ffm->params.fps_den, ffm->params.fps_num};
ffm->video_stream->time_base = context->time_base;
#if LIBAVFORMAT_VERSION_MAJOR < 59
// codec->time_base may still be used if LIBAVFORMAT_VERSION_MAJOR < 59
ffm->video_stream->codec->time_base = context->time_base;
#endif
ffm->video_stream->avg_frame_rate = av_inv_q(context->time_base);
if (ffm->output->oformat->flags & AVFMT_GLOBALHEADER)