changeset 31847:273d40130183

Move one AES initialization out of inner loop.
author reimar
date Wed, 04 Aug 2010 13:39:10 +0000
parents 3f84ee74869d
children 1241f62e54e7
files stream/stream_bd.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_bd.c	Wed Aug 04 13:32:20 2010 +0000
+++ b/stream/stream_bd.c	Wed Aug 04 13:39:10 2010 +0000
@@ -271,9 +271,6 @@
         key enc_seed;
         bd->iv = BD_CBC_IV;
 
-        // set up AES key from uk and seed
-        av_aes_init(bd->aeseed, bd->uks.keys[0].u8, 128, 0);
-
         // perform encryption of first 16 bytes of unit (seed)
         av_aes_crypt(bd->aeseed, enc_seed.u8, buf, 1, NULL, 0);
 
@@ -340,6 +337,9 @@
     bd->aescbc = av_malloc(av_aes_size);
     bd->aeseed = av_malloc(av_aes_size);
 
+    // set up AES key from uk
+    av_aes_init(bd->aeseed, bd->uks.keys[0].u8, 128, 0);
+
     snprintf(filename, sizeof(filename), BD_M2TS_PATH, bd->device, bd->title);
     mp_msg(MSGT_OPEN, MSGL_STATUS, "Opening %s\n", filename);
     bd->title_file = fopen(filename, "rb");