]> git.sesse.net Git - vlc/blobdiff - modules/access_filter/timeshift.c
Less memleaks in Qt interface.
[vlc] / modules / access_filter / timeshift.c
index 97f650d1818cb8c57cdb35f0f4143834f63dc241..b01cc1c649e54e8e7e1b661edec8e9a2e57a1ec9 100644 (file)
@@ -29,7 +29,8 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
+#include <vlc_plugin.h>
 
 #include <errno.h>
 
@@ -61,8 +62,8 @@ static void Close( vlc_object_t * );
   "access declares that it can control pace or pause." )
 
 vlc_module_begin();
-    set_shortname( _("Timeshift") );
-    set_description( _("Timeshift") );
+    set_shortname( N_("Timeshift") );
+    set_description( N_("Timeshift") );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_ACCESS_FILTER );
     set_capability( "access_filter", 0 );
@@ -137,14 +138,14 @@ static int Open( vlc_object_t *p_this )
     else
     {
         /* Only work with not pace controled access */
-        if( access2_Control( p_src, ACCESS_CAN_CONTROL_PACE, &b_bool ) ||
+        if( access_Control( p_src, ACCESS_CAN_CONTROL_PACE, &b_bool ) ||
             b_bool )
         {
             msg_Dbg( p_src, "ACCESS_CAN_CONTROL_PACE: timeshift useless" );
             return VLC_EGENERIC;
         }
         /* Refuse access that can be paused */
-        if( access2_Control( p_src, ACCESS_CAN_PAUSE, &b_bool ) || b_bool )
+        if( access_Control( p_src, ACCESS_CAN_PAUSE, &b_bool ) || b_bool )
         {
             msg_Dbg( p_src, "ACCESS_CAN_PAUSE: timeshift useless" );
             return VLC_EGENERIC;
@@ -161,7 +162,7 @@ static int Open( vlc_object_t *p_this )
     p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) );
 
     /* */
-    p_sys->p_fifo = block_FifoNew( p_access );
+    p_sys->p_fifo = block_FifoNew();
     p_sys->i_write_size = 0;
     p_sys->i_files = 0;
     p_sys->i_data = 0;
@@ -274,7 +275,7 @@ static void Thread( access_t *p_access )
     access_t     *p_src = p_access->p_source;
     block_t      *p_block;
 
-    while( !p_access->b_die )
+    while( vlc_object_alive (p_access) )
     {
         /* Get a new block from the source */
         if( p_src->pf_block )
@@ -319,7 +320,7 @@ static void Thread( access_t *p_access )
 
         /* Read from file to fill up the fifo */
         while( block_FifoSize( p_sys->p_fifo ) < TIMESHIFT_FIFO_MIN &&
-               !p_access->b_die )
+               vlc_object_alive (p_access) )
         {
             p_block = ReadBlockFromFile( p_access );
             if( !p_block ) break;
@@ -330,12 +331,12 @@ static void Thread( access_t *p_access )
 
     msg_Dbg( p_access, "timeshift: no more input data" );
 
-    while( !p_access->b_die &&
+    while( vlc_object_alive (p_access) &&
            (p_sys->p_read_list || block_FifoSize( p_sys->p_fifo ) ) )
     {
         /* Read from file to fill up the fifo */
         while( block_FifoSize( p_sys->p_fifo ) < TIMESHIFT_FIFO_MIN &&
-               !p_access->b_die && p_sys->p_read_list )
+               vlc_object_alive (p_access) && p_sys->p_read_list )
         {
             p_block = ReadBlockFromFile( p_access );
             if( !p_block ) break;
@@ -550,7 +551,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
 
     /* Forward everything else to the source access */
     default:
-        return access2_vaControl( p_access->p_source, i_query, args );
+        return access_vaControl( p_access->p_source, i_query, args );
     }
     return VLC_SUCCESS;
 }