Add decryption support.
[dcpomatic.git] / src / lib / ffmpeg.cc
index 5171166d5f0e9aeea6ea9ae60cbe5dd391cf79df..1502b3de96148d76a94b4d1a8d5f2fb4ea3dd082 100644 (file)
@@ -128,6 +128,9 @@ FFmpeg::setup_general ()
        */
        av_dict_set (&options, "analyzeduration", raw_convert<string> (5 * 60 * 1000000).c_str(), 0);
        av_dict_set (&options, "probesize", raw_convert<string> (5 * 60 * 1000000).c_str(), 0);
+       if (_ffmpeg_content->decryption_key()) {
+               av_dict_set (&options, "decryption_key", _ffmpeg_content->decryption_key()->c_str(), 0);
+       }
 
        int e = avformat_open_input (&_format_context, 0, 0, &options);
        if (e < 0) {