Permalink
Browse files

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

  • Loading branch information...
endrift committed Jan 18, 2018
1 parent abf1af3 commit 6dd18fd86e8b37d068ef8b3ba36739fb1597f985
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/feature/ffmpeg/ffmpeg-encoder.c
@@ -229,7 +229,11 @@ bool FFmpegEncoderOpen(struct FFmpegEncoder* encoder, const char* outfile) {
AVDictionary* opts = 0;
av_dict_set(&opts, "strict", "-2", 0);
if (encoder->context->oformat->flags & AVFMT_GLOBALHEADER) {
+#ifdef AV_CODEC_FLAG_GLOBAL_HEADER
+ encoder->audio->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
+#else
encoder->audio->flags |= CODEC_FLAG_GLOBAL_HEADER;
+#endif
}
avcodec_open2(encoder->audio, acodec, &opts);
av_dict_free(&opts);

0 comments on commit 6dd18fd

Please sign in to comment.