<div dir="ltr">Hi, TypX!<div>Thank you for the comments!</div><div><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
><br>
> /* video frame */<br>
> +<br>
> + /* initialize AES context, if reel is encrypted */<br>
> + if( p_sys->p_dcp->video_reels[p_sys->i_video_reel].p_key ) {<br>
> + p_video_aes_ctx = new (nothrow) AESDecContext;<br>
Isn't it possible to just store your AESDecContext in the p_sys and only<br>
call p_video_aes_ctx->InitKey() when needed? It would avoid to<br>
allocate/free at each iteration.<br></blockquote><div>Well, I tried doing that, in more than one way, but everytime I separated the InitKey of the ReadFrame, I got un ugly seg fault.</div><div>I know this is less probably to be a bug in the asdcplib, still, I wrote to the authors. Got no answer. </div>
<div>I will retry separating them (maybe I did smth wrong), and if the problem persists, I will spam their emails until they answer me...</div><div>Up until then, this version is functional enough... right?</div><div><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> +<br>
> + // read first node and check if it is a KDM<br>
> + // TODO is this always the name of the tag?<br>
> + if( ! ( ( XML_READER_STARTELEM == ReadNextNode( this->p_xmlReader, node ) ) && ( node == s_root_node ) ) )<br>
> + {<br>
> + msg_Err( this->p_demux, "not a valid XML KDM" );<br>
> + goto error;<br>
> + }<br>
> +<br>
> + while( ( type = ReadNextNode( this->p_xmlReader, node ) ) > 0 )<br>
> + if( type == XML_READER_STARTELEM && node == "AuthenticatedPrivate" )<br>
> + {<br>
> + _p_key_list = new (nothrow) AESKeyList;<br>
> + if( unlikely( _p_key_list == NULL ) )<br>
> + {<br>
> + msg_Err( p_demux, "could not alloc memory" );<br>
Avoid traces when you have memory allocation issues.<br>
> + goto error;<br>
> + }<br>
> + p_dcp->p_key_list = _p_key_list;<br>
I assume that this node can happen only once (or it will leak).<br></blockquote><div>Yes, AuthenticatedPrivate appears only once in any KDM. Anyway, I break after finding it (see below).</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> + if( this->ParsePrivate( node, type ) )<br>
> + goto error;<br>
> +<br>
> + /* keys found so break */<br>
> + break;<br>
> + }<br>
> +<br></blockquote><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> +<br>
> + /* get private key file path */<br>
> + if( ! ( psz_config_dir = config_GetUserDir( VLC_CONFIG_DIR ) ) )<br>
config dir? looks tedious</blockquote><div>What do you mean?</div><div>We need a place were to keep the private key. In current Digital Cinema it is well hidden in the projector. In our case it should be well hidden somewhere in the computer. We don't know exactly how it would be the best to do that for now, but for the beginning we thought of this config dir of VLC.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
> +<br>
> + /* extract the AES key UUID */<br>
> + if( ( this->s_key_id = createUUID( strndup( ( const char* )psz_plain_text + pos, 16 ) ) ).empty() )<br>
why duplicating the string and freeing it in createUUID?<br></blockquote><div>The createUUID function came after the strndup, didn't notice the overhead. Thanks.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
><br>
> vector<PKL *> pkls;<br>
> AssetList *p_asset_list;<br>
> + AESKeyList *p_key_list;<br>
why storing list pointers instead of lists?<br></blockquote><div>good question. BuxiNess must know, I just followed the model :D. I'll ask and modify accordingly.</div><div><br></div></div>Thanks!</div></div></div>