Permalink
Browse files

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

  • Loading branch information...
endrift committed Jan 18, 2018
1 parent c76b1b7 commit bf7247ad4c6e30b428d444607f14242f8f4f4a2d
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/feature/ffmpeg/ffmpeg-encoder.c
@@ -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

0 comments on commit bf7247a

Please sign in to comment.