X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg.cc;h=17ec564d321fa04fbec6f1760816500fc53a53e5;hb=09063d5958cad17ce89935f38f12c4fcbaaedf4f;hp=8a0dcb5930afaad11cff0706d9ab3df7c199b814;hpb=9bbeb511d23c5aa319da406ec39382fdeddd04ea;p=dcpomatic.git diff --git a/src/lib/ffmpeg.cc b/src/lib/ffmpeg.cc index 8a0dcb593..17ec564d3 100644 --- a/src/lib/ffmpeg.cc +++ b/src/lib/ffmpeg.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2013-2016 Carl Hetherington + Copyright (C) 2013-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -27,8 +27,10 @@ #include "dcpomatic_log.h" #include "ffmpeg_subtitle_stream.h" #include "ffmpeg_audio_stream.h" +#include "decrypted_ecinema_kdm.h" #include "digester.h" #include "compose.hpp" +#include "config.h" #include extern "C" { #include @@ -48,6 +50,7 @@ using std::vector; using boost::shared_ptr; using boost::optional; using dcp::raw_convert; +using namespace dcpomatic; boost::mutex FFmpeg::_mutex; @@ -122,9 +125,12 @@ FFmpeg::setup_general () */ av_dict_set (&options, "analyzeduration", raw_convert (5 * 60 * 1000000).c_str(), 0); av_dict_set (&options, "probesize", raw_convert (5 * 60 * 1000000).c_str(), 0); - if (_ffmpeg_content->decryption_key()) { - av_dict_set (&options, "decryption_key", _ffmpeg_content->decryption_key()->c_str(), 0); +#ifdef DCPOMATIC_VARIANT_SWAROOP + if (_ffmpeg_content->kdm()) { + DecryptedECinemaKDM kdm (_ffmpeg_content->kdm().get(), Config::instance()->decryption_chain()->key().get()); + av_dict_set (&options, "decryption_key", kdm.key().hex().c_str(), 0); } +#endif int e = avformat_open_input (&_format_context, 0, 0, &options); if (e < 0) {