diff --git a/simgear/screen/video-encoder-internal.hxx b/simgear/screen/video-encoder-internal.hxx index 9f905dcb..9b5b4346 100644 --- a/simgear/screen/video-encoder-internal.hxx +++ b/simgear/screen/video-encoder-internal.hxx @@ -279,7 +279,7 @@ struct FfmpegEncoder /* Resolution must be a multiple of two. */ m_codec_context->width = width / 2 * 2; m_codec_context->height = height / 2 * 2; - m_codec_context->time_base = (AVRational){ 1, 60 }; + m_codec_context->time_base = AVRational{ 1, 60 }; //m_codec_context->gop_size = 12; /* emit one intra m_frame every twelve frames at most */ m_codec_context->pix_fmt = AV_PIX_FMT_YUV420P; /* Some formats want m_stream headers to be separate. */ diff --git a/simgear/screen/video-encoder.cxx b/simgear/screen/video-encoder.cxx index 29b26c59..5597b0de 100644 --- a/simgear/screen/video-encoder.cxx +++ b/simgear/screen/video-encoder.cxx @@ -170,10 +170,18 @@ static void av_log(void* /*avcl*/, int level, const char* format, va_list va) if (level < 44) sglevel = SG_DEBUG; if (level < 54) sglevel = SG_BULK; else sglevel = SG_BULK; - char* message = nullptr; - vasprintf(&message, format, va); + #ifdef _WIN32 + /* Windows does not have vasprintf(). */ + char message[200]; + vsnprintf(message, sizeof(message), format, va); + #else + char* message = nullptr; + vasprintf(&message, format, va); + #endif SG_LOG(SG_VIEW, sglevel, "level=" << level << ": " << message); - free(message); + #ifndef _WIN32 + free(message); + #endif } VideoEncoder::VideoEncoder(