]> git.sesse.net Git - vlc/blobdiff - modules/access/dv.c
Access/cdda: fix memleak
[vlc] / modules / access / dv.c
index 90c6a9f4013dba841b1c86e02cc69c8ce6dda586..911a7f8673522035da130fed4800c6d219627cf2 100644 (file)
@@ -28,7 +28,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_plugin.h>
 #include <vlc_access.h>
 
@@ -74,8 +74,8 @@ static int Control( access_t *, int, va_list );
     "value should be set in milliseconds." )
 
 vlc_module_begin();
-    set_description( _("Digital Video (Firewire/ieee1394)  input") );
-    set_shortname( _("dv") );
+    set_description( N_("Digital Video (Firewire/ieee1394)  input") );
+    set_shortname( N_("dv") );
     set_category( CAT_INPUT );
     set_subcategory( SUBCAT_INPUT_ACCESS );
     add_integer( "dv-caching", 60000 / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, true );
@@ -340,8 +340,13 @@ static block_t *Block( access_t *p_access )
     access_sys_t *p_sys = p_access->p_sys;
     block_t *p_block = NULL;
 
-//     if( !p_access->psz_demux )
-//         p_access->psz_demux = strdup( "rawdv" );
+#if 0
+    if( !p_access->psz_demux )
+    {
+        free( p_access->psz_demux );
+        p_access->psz_demux = strdup( "rawdv" );
+    }
+#endif
 
     vlc_mutex_lock( &p_sys->lock );
     p_block = p_sys->p_frame;
@@ -363,7 +368,7 @@ static int Raw1394EventThread( vlc_object_t *p_this )
 
     vlc_thread_ready( p_this );
 
-    while( !p_sys->p_ev->b_die )
+    while( vlc_object_alive (p_sys->p_ev) )
     {
         while( ( result = poll( &(p_sys->raw1394_poll), 1, 200 ) ) < 0 )
         {
@@ -372,10 +377,8 @@ static int Raw1394EventThread( vlc_object_t *p_this )
                 perror( "error: raw1394 poll" );
                 msg_Err( p_access, "retrying device raw1394" );
             }
-            if( p_sys->p_ev->b_die )
-                break;
         }
-        if( p_sys->p_ev->b_die )
+        if( !vlc_object_alive (p_sys->p_ev) )
                 break;
         if( result > 0 && ( ( p_sys->raw1394_poll.revents & POLLIN )
                 || ( p_sys->raw1394_poll.revents & POLLPRI ) ) )