[PATCH] Title key cache and minor fixes

H}kan Hjort d95hjort at dtek.chalmers.se
Mon Jul 1 15:42:45 CEST 2002


Mon Jul 01 2002, adam at yggdrasl.demon.co.uk wrote:
> d95hjort at dtek.chalmers.se wrote:
> > Mon Jul 01 2002, adam at yggdrasl.demon.co.uk wrote:
> 
> > > When inserting a key at the start of a non-empty list, the first list
> > > item was being lost (but not freed).
> > Ok, I rewrote it a bit.  No need to add that extra if.
> 
> Right.  I thought there was probably a way, but it just didn't spring to
> mind whilst I was writing.
> 
This is what I checked in.

Index: src/libdvdcss.c
===================================================================
RCS file: /var/cvs/videolan/libdvdcss/src/libdvdcss.c,v
retrieving revision 1.11
diff -p -u -d -r1.11 libdvdcss.c
--- src/libdvdcss.c	2002/06/04 07:02:57	1.11
+++ src/libdvdcss.c	2002/07/01 13:38:55
@@ -337,7 +337,7 @@ extern int dvdcss_title ( dvdcss_handle 
     }
     else if( i_ret == 0 )
     {
-        _dvdcss_debug( dvdcss, "unecrypted title" );
+        _dvdcss_debug( dvdcss, "unencrypted title" );
         /* Still store this in the cache, so we don't need to check again. */
     }
 
@@ -358,12 +358,13 @@ extern int dvdcss_title ( dvdcss_handle 
     p_newtitle->i_startlb = i_block;
     memcpy( p_newtitle->p_key, p_title_key, KEY_SIZE );
 
-    /* Link the new title, either at the beginning or inside the list */
+    /* Link it at the head of the (possibly empty) list */
     if( p_title == NULL )
     {
+        p_newtitle->p_next = dvdcss->p_titles;
         dvdcss->p_titles = p_newtitle;
-        p_newtitle->p_next = NULL;
     }
+    /* Link the new title inside the list */
     else
     {
         p_newtitle->p_next = p_title->p_next;

-- 
Håkan Hjort

-- 
This is the libdvdcss-devel mailing-list, see http://www.videolan.org/libdvdcss/
To unsubscribe, please read http://www.videolan.org/lists.html
If you are in trouble, please contact <postmaster at videolan.org>



More information about the libdvdcss-devel mailing list