FFmpeg: Fix build with newer lavc (fixes #966)

This commit is contained in:
Vicki Pfau 2018-01-17 22:53:26 -08:00
parent c76b1b7a01
commit bf7247ad4c
1 changed files with 4 additions and 0 deletions

View File

@ -291,7 +291,11 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
encoder->video->gop_size = 60;
encoder->video->max_b_frames = 3;
if (encoder->context->oformat->flags & AVFMT_GLOBALHEADER) {
#ifdef AV_CODEC_FLAG_GLOBAL_HEADER
encoder->video->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
#else
encoder->video->flags |= CODEC_FLAG_GLOBAL_HEADER;
#endif
}
if (strcmp(vcodec->name, "libx264") == 0) {
// Try to adaptively figure out when you can use a slower encoder