[MPlayer-dev-eng] [PATCH] Initial Bluray support

Nico Sabbi nicola.sabbi at poste.it
Sun Sep 13 14:55:05 CEST 2009



In addition to Reimar's comments:
> 
> 
> 
> 
> 
> 
> +  *file_format = DEMUXER_TYPE_LAVF;

doesn't it work with the native TS demuxer?

> +
> +static void bd_stream_close(stream_t *s) {
> +  fclose(((bd_priv_t *)(s->priv))->title_file);
> +  free(((bd_priv_t *)(s->priv))->uks.keys);
> +  free(s->priv);
> +}

all those casts are really ugly

> +
> +  if(s->type == STREAMTYPE_BD) {

is there any reason to believe that s->type can be != STREAMTYPE_BD?


> +  // set up AES key from uk and seed
> +//  a=av_malloc(av_aes_size);
> +//  av_aes_init(a,bd->uks.keys[0].dec_key,128,1);
> +  // perform encryption of first 16 bytes of unit (seed)
> +//  av_aes_crypt(a,enc_seed,buf,1,NULL,1);
> +  
> +//  free(a);
> +
> +  // perform xor
> +  for(i=0;i<16;i++) enc_seed[i]^=buf[i];
> +
> +  // set uk AES-CBC key from enc_seed and BD_CBC_IV
> +//  a=av_malloc(av_aes_size);
> +//  av_aes_init(a,enc_seed,128,0);
> +
> +  // decrypt unit
> +  memcpy(iv,BD_CBC_IV,16);
> +//  av_aes_crypt(a,&buf[16],&buf[16],(BD_UNIT_SIZE-16)/16,iv,0);
> +
> +AES_KEY aes_new_key;
> +AES_set_decrypt_key( enc_seed, 128, &aes_new_key );
> +AES_cbc_encrypt( &buf[16], &buf[16], 6128, &aes_new_key, iv, 0 );
> +
> +  // mark packets as decrypted
> +  for(i=0;i<BD_UNIT_SIZE;i++)
> +    if(!(i%192)||!i)
> +      buf[i]&=0x3f;
> +
> +//  free(a);
> +}
> +


please, remove all those commented out code. When it's working it can be
added back in.




More information about the MPlayer-dev-eng mailing list