[MPlayer-cvslog] r31924 - trunk/stream/stream_bd.c

reimar subversion at mplayerhq.hu
Wed Aug 4 15:27:19 CEST 2010


Author: reimar
Date: Wed Aug  4 15:27:19 2010
New Revision: 31924

Log:
Use the "key" type also for the IV constant.

Modified:
   trunk/stream/stream_bd.c

Modified: trunk/stream/stream_bd.c
==============================================================================
--- trunk/stream/stream_bd.c	Wed Aug  4 14:38:52 2010	(r31923)
+++ trunk/stream/stream_bd.c	Wed Aug  4 15:27:19 2010	(r31924)
@@ -36,11 +36,6 @@ static const char *BD_M2TS_PATH = "/%s/B
 
 static const char *DEFAULT_BD_DEVICE = "/mnt/bd";
 
-static const uint8_t BD_CBC_IV[] = {
-    0x0b, 0xa0, 0xf8, 0xdd, 0xfe, 0xa6, 0x1f, 0xb3,
-    0xd8, 0xdf, 0x9f, 0x56, 0x6a, 0x05, 0x0f, 0x78
-};
-
 static const struct stream_priv_s {
     int   title;
     char *device;
@@ -72,6 +67,13 @@ typedef union {
     uint8_t  u8[16];
 } key;
 
+static const key BD_CBC_IV = {
+    .u8 = {
+    0x0b, 0xa0, 0xf8, 0xdd, 0xfe, 0xa6, 0x1f, 0xb3,
+    0xd8, 0xdf, 0x9f, 0x56, 0x6a, 0x05, 0x0f, 0x78
+    }
+};
+
 struct uks {
     int  count;
     key *keys;
@@ -267,7 +269,7 @@ static off_t bd_read(struct bd_priv *bd,
         // reset aes context as at start of unit
         key enc_seed;
         int i;
-        memcpy(bd->iv.u8, BD_CBC_IV, sizeof(bd->iv.u8));
+        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);


More information about the MPlayer-cvslog mailing list