]> git.sesse.net Git - vlc/blobdiff - modules/access_filter/timeshift.c
Remove change_unsafe() no-op.
[vlc] / modules / access_filter / timeshift.c
index e2e39bb686eb73982fb8deb1b34be16c73fbbb1e..a1e353a51e882f927bea53b7999270b7fbf250bd 100644 (file)
@@ -73,7 +73,6 @@ vlc_module_begin();
     add_integer( "timeshift-granularity", 50, NULL, GRANULARITY_TEXT,
                  GRANULARITY_LONGTEXT, true );
     add_directory( "timeshift-dir", 0, 0, DIR_TEXT, DIR_LONGTEXT, false );
-        change_unsafe();
     add_bool( "timeshift-force", false, NULL, FORCE_TEXT, FORCE_LONGTEXT,
               false );
 vlc_module_end();
@@ -279,6 +278,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 */
@@ -357,6 +357,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;
 }
 
@@ -378,12 +379,7 @@ static void NextFileWrite( access_t *p_access )
 
     /* Put written file in read list */
     if( p_sys->i_write_size < p_sys->i_file_size )
-        if( ftruncate( fileno( p_sys->p_write_list->file ),
-                       p_sys->i_write_size ) == -1 )
-        {
-            msg_Dbg( p_access, "unable to truncate file: %m" );
-            /* return; */
-        }
+        ftruncate( fileno( p_sys->p_write_list->file ), p_sys->i_write_size );
 
     fseek( p_sys->p_write_list->file, 0, SEEK_SET );
     *p_sys->pp_read_last = p_sys->p_write_list;
@@ -607,8 +603,8 @@ static char *GetTmpFilePath( access_t *p_access )
 #endif
     }
 
-    if( asprintf( &psz_filename_base, "%s/vlc-timeshift-%d-%d-",
-              psz_dir, getpid(), p_access->i_object_id ) == -1 )
+    if( asprintf( &psz_filename_base, "%s/vlc-timeshift-%d-%p-",
+              psz_dir, getpid(), p_access ) == -1 )
         psz_filename_base = NULL;
     free( psz_dir );