X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fdv.c;h=372bf74653301345775aab0310b5e47d92a71d30;hb=bc09c365ab435fda0185e60a423f69d6dfa348c8;hp=e75e87d6b2abfd4ba6af5097f1f184d884e4929d;hpb=e7ee6a9d861ea4f62a828ebd929f8ecd15b4163f;p=vlc diff --git a/modules/access/dv.c b/modules/access/dv.c index e75e87d6b2..372bf74653 100644 --- a/modules/access/dv.c +++ b/modules/access/dv.c @@ -33,9 +33,7 @@ #include #include -#ifdef HAVE_SYS_TYPES_H -# include -#endif +#include #ifdef HAVE_UNISTD_H # include #elif defined( WIN32 ) && !defined( UNDER_CE ) @@ -71,9 +69,7 @@ vlc_module_begin () add_integer( "dv-caching", 60000 / 1000, NULL, CACHING_TEXT, CACHING_LONGTEXT, true ) change_safe() set_capability( "access", 0 ) - add_shortcut( "dv" ) - add_shortcut( "dv1394" ) - add_shortcut( "raw1394" ) + add_shortcut( "dv", "dv1394", "raw1394" ) set_callbacks( Open, Close ) vlc_module_end () @@ -135,11 +131,10 @@ static int Open( vlc_object_t *p_this ) { access_t *p_access = (access_t*)p_this; access_sys_t *p_sys; - char *psz_name = strdup( p_access->psz_path ); struct raw1394_portinfo port_inf[ 16 ]; - msg_Dbg( p_access, "opening device %s", psz_name ); + msg_Dbg( p_access, "opening device" ); /* Set up p_access */ access_InitFields( p_access ); @@ -147,10 +142,7 @@ static int Open( vlc_object_t *p_this ) p_access->p_sys = p_sys = malloc( sizeof( access_sys_t ) ); if( !p_sys ) - { - free( psz_name ); return VLC_EGENERIC; - } p_sys->i_cards = 0; p_sys->i_node = 0; @@ -169,42 +161,37 @@ static int Open( vlc_object_t *p_this ) { msg_Err( p_access, "failed to open a Firewire (IEEE1394) connection" ); Close( p_this ); - free( psz_name ); return VLC_EGENERIC; } p_sys->p_avc1394 = AVCOpen( p_access, p_sys->i_port ); if( !p_sys->p_avc1394 ) { - msg_Err( p_access, "no Digital Video Control device found on %s", psz_name ); + msg_Err( p_access, "no Digital Video Control device found" ); Close( p_this ); - free( psz_name ); return VLC_EGENERIC; } p_sys->p_raw1394 = raw1394_new_handle(); if( !p_sys->p_raw1394 ) { - msg_Err( p_access, "no Digital Video device found on %s", psz_name ); + msg_Err( p_access, "no Digital Video device found" ); Close( p_this ); - free( psz_name ); return VLC_EGENERIC; } p_sys->i_cards = raw1394_get_port_info( p_sys->p_raw1394, port_inf, 16 ); if( p_sys->i_cards < 0 ) { - msg_Err( p_access, "failed to get port info for %s", psz_name ); + msg_Err( p_access, "failed to get port info" ); Close( p_this ); - free( psz_name ); return VLC_EGENERIC; } if( raw1394_set_port( p_sys->p_raw1394, p_sys->i_port ) < 0 ) { - msg_Err( p_access, "failed to set port info for %s", psz_name ); + msg_Err( p_access, "failed to set port info" ); Close( p_this ); - free( psz_name ); return VLC_EGENERIC; } @@ -212,9 +199,8 @@ static int Open( vlc_object_t *p_this ) ISOCHRONOUS_QUEUE_LENGTH, ISOCHRONOUS_MAX_PACKET_SIZE, p_sys->i_channel, RAW1394_DMA_PACKET_PER_BUFFER, -1 ) < 0 ) { - msg_Err( p_access, "failed to init isochronous recv for %s", psz_name ); + msg_Err( p_access, "failed to init isochronous recv" ); Close( p_this ); - free( psz_name ); return VLC_EGENERIC; } @@ -231,9 +217,8 @@ static int Open( vlc_object_t *p_this ) p_sys->p_ev = vlc_object_create( p_access, sizeof( event_thread_t ) ); if( !p_sys->p_ev ) { - msg_Err( p_access, "failed to create event thread for %s", psz_name ); + msg_Err( p_access, "failed to create event thread" ); Close( p_this ); - free( psz_name ); return VLC_EGENERIC; } @@ -244,7 +229,6 @@ static int Open( vlc_object_t *p_this ) vlc_thread_create( p_sys->p_ev, "dv event thread handler", Raw1394EventThread, VLC_THREAD_PRIORITY_OUTPUT ); - free( psz_name ); return VLC_SUCCESS; } @@ -308,7 +292,7 @@ static int Control( access_t *p_access, int i_query, va_list args ) case ACCESS_GET_PTS_DELAY: *va_arg( args, int64_t * ) - = (int64_t)var_GetInteger( p_access, "dv-caching" ) * 1000; + = var_GetInteger( p_access, "dv-caching" ) * 1000; break; /* */