]> git.sesse.net Git - vlc/blobdiff - modules/access_filter/timeshift.c
Qt: use the CoverArtLabel in the playlist view and media information dialog
[vlc] / modules / access_filter / timeshift.c
index b90e26131028d32bfb1d8330f1e2309c669aabea..02fae43a094cb0108f5f5db62c536ee44202b394 100644 (file)
@@ -105,9 +105,9 @@ struct access_sys_t
 {
     block_fifo_t *p_fifo;
 
-    int  i_files;
-    int  i_file_size;
-    int  i_write_size;
+    unsigned  i_files;
+    unsigned  i_file_size;
+    unsigned  i_write_size;
 
     ts_entry_t *p_read_list;
     ts_entry_t **pp_read_last;
@@ -160,6 +160,8 @@ static int Open( vlc_object_t *p_this )
     p_access->info = p_src->info;
 
     p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
+    if( !p_sys )
+        return VLC_ENOMEM;
 
     /* */
     p_sys->p_fifo = block_FifoNew();
@@ -186,6 +188,7 @@ static int Open( vlc_object_t *p_this )
     if( vlc_thread_create( p_access, "timeshift thread", Thread,
                            VLC_THREAD_PRIORITY_LOW, false ) )
     {
+        Close( p_this );
         msg_Err( p_access, "cannot spawn timeshift access thread" );
         return VLC_EGENERIC;
     }
@@ -201,7 +204,7 @@ static void Close( vlc_object_t *p_this )
     access_t     *p_access = (access_t*)p_this;
     access_sys_t *p_sys = p_access->p_sys;
     ts_entry_t *p_entry;
-    int i;
+    unsigned i;
 
     msg_Dbg( p_access, "timeshift close called" );
     vlc_thread_join( p_access );
@@ -276,6 +279,7 @@ static void* Thread( vlc_object_t* p_this )
     access_t     *p_src = p_access->p_source;
     block_t      *p_block;
 
+    int canc = vlc_savecancel ();
     while( vlc_object_alive (p_access) )
     {
         /* Get a new block from the source */
@@ -354,6 +358,7 @@ static void* Thread( vlc_object_t* p_this )
 
     /* Send dummy packet to avoid deadlock in Block() */
     block_FifoPut( p_sys->p_fifo, block_New( p_access, 0 ) );
+    vlc_restorecancel (canc);
     return NULL;
 }
 
@@ -427,7 +432,7 @@ static int WriteBlockToFile( access_t *p_access, block_t *p_block )
     {
         FILE *file;
 
-        sprintf( p_sys->psz_filename, "%s%i.dat",
+        sprintf( p_sys->psz_filename, "%s%u.dat",
                  p_sys->psz_filename_base, p_sys->i_files );
         file = utf8_fopen( p_sys->psz_filename, "w+b" );
 
@@ -519,6 +524,8 @@ static block_t *ReadBlockFromFile( access_t *p_access )
 static int Seek( access_t *p_access, int64_t i_pos )
 {
     //access_sys_t *p_sys = p_access->p_sys;
+    (void)p_access;
+    (void)i_pos;
     return VLC_SUCCESS;
 }