]> git.sesse.net Git - vlc/blobdiff - modules/access/dv.c
live555 : don't call ES_OUT_SET_ES_STATE with NULL pointer
[vlc] / modules / access / dv.c
index 782978d245c9018984bcf08f506f7dbd60c5c436..f9b7bf2a3359658f88038ac61ad132a7a3127c98 100644 (file)
@@ -56,18 +56,11 @@ static void Close( vlc_object_t * );
 static block_t *Block( access_t * );
 static int Control( access_t *, int, va_list );
 
-#define CACHING_TEXT N_("Caching value in ms")
-#define CACHING_LONGTEXT N_( \
-    "Caching value for DV streams. This " \
-    "value should be set in milliseconds." )
-
 vlc_module_begin ()
     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, CACHING_TEXT, CACHING_LONGTEXT, true )
-        change_safe()
     set_capability( "access", 0 )
     add_shortcut( "dv", "dv1394", "raw1394" )
     set_callbacks( Open, Close )
@@ -209,24 +202,26 @@ static int Open( vlc_object_t *p_this )
     p_sys->raw1394_poll.fd = raw1394_get_fd( p_sys->p_raw1394 );
     p_sys->raw1394_poll.events = POLLIN | POLLPRI;
 
-    /* Update default_pts to a suitable value for udp access */
-    var_Create( p_access, "dv-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
-
     /* Now create our event thread catcher */
     p_sys->p_ev = calloc( 1, sizeof( *p_sys->p_ev ) );
     if( !p_sys->p_ev )
     {
-        msg_Err( p_access, "failed to create event thread" );
+        msg_Err( p_access, "failed to create event thread struct" );
         Close( p_this );
-        return VLC_EGENERIC;
+        return VLC_ENOMEM;
     }
 
     p_sys->p_ev->p_frame = NULL;
     p_sys->p_ev->pp_last = &p_sys->p_ev->p_frame;
     p_sys->p_ev->p_access = p_access;
     vlc_mutex_init( &p_sys->p_ev->lock );
-    vlc_clone( &p_sys->p_ev->thread, Raw1394EventThread,
-               p_sys->p_ev, VLC_THREAD_PRIORITY_OUTPUT );
+    if( vlc_clone( &p_sys->p_ev->thread, Raw1394EventThread,
+               p_sys->p_ev, VLC_THREAD_PRIORITY_OUTPUT ) )
+    {
+        msg_Err( p_access, "failed to clone event thread" );
+        Close( p_this );
+        return VLC_EGENERIC;
+    }
 
     return VLC_SUCCESS;
 }
@@ -290,8 +285,8 @@ static int Control( access_t *p_access, int i_query, va_list args )
             break;
 
         case ACCESS_GET_PTS_DELAY:
-            *va_arg( args, int64_t * )
-                   = var_GetInteger( p_access, "dv-caching" ) * 1000;
+            *va_arg( args, int64_t * ) =
+                INT64_C(1000) * var_InheritInteger( p_access, "live-caching" );
             break;
 
         /* */