From 372555641062f5c7c6e4a1d5f67cfaf12a2c6799 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 21 Jul 2019 00:51:35 +0100 Subject: [PATCH] swaroop: fix encryption of files encoded from DCP. --- src/lib/ffmpeg_file_encoder.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/ffmpeg_file_encoder.cc b/src/lib/ffmpeg_file_encoder.cc index af6066bfd..09845ac34 100644 --- a/src/lib/ffmpeg_file_encoder.cc +++ b/src/lib/ffmpeg_file_encoder.cc @@ -125,9 +125,10 @@ FFmpegFileEncoder::FFmpegFileEncoder ( throw runtime_error ("could not open FFmpeg output file"); } + AVDictionary* options = 0; + #ifdef DCPOMATIC_VARIANT_SWAROOP if (key) { - AVDictionary* options = 0; av_dict_set (&options, "encryption_key", key->hex().c_str(), 0); /* XXX: is this OK? */ av_dict_set (&options, "encryption_kid", "00000000000000000000000000000000", 0); @@ -141,7 +142,7 @@ FFmpegFileEncoder::FFmpegFileEncoder ( } #endif - if (avformat_write_header (_format_context, 0) < 0) { + if (avformat_write_header (_format_context, &options) < 0) { throw runtime_error ("could not write header to FFmpeg output file"); } -- 2.30.2