summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-07-21 00:51:35 +0100
committerCarl Hetherington <cth@carlh.net>2019-07-21 00:51:35 +0100
commit372555641062f5c7c6e4a1d5f67cfaf12a2c6799 (patch)
tree1c814674868efb8f20131ff3c67e8e8dd0a69299
parent808e59c34c848f827a4fb4a726fc1258e6e6aa05 (diff)
swaroop: fix encryption of files encoded from DCP.
-rw-r--r--src/lib/ffmpeg_file_encoder.cc5
1 files 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");
}