X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fdc1394.c;h=381e14a73050a0d080798d276b1164ad543e170a;hb=88b1d54a0d3eb0b66aac5b1eb24867bc355d54e1;hp=6cde55e46064d6772afb60bc2e1bbdc48d44b244;hpb=bae7c730d18969a1872770fc9d1a6f587dae66c5;p=vlc diff --git a/modules/access/dc1394.c b/modules/access/dc1394.c index 6cde55e460..381e14a730 100644 --- a/modules/access/dc1394.c +++ b/modules/access/dc1394.c @@ -26,7 +26,12 @@ * Preamble *****************************************************************************/ -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include #include #include #include @@ -59,7 +64,7 @@ static void OpenAudioDev( demux_t *p_demux ); static inline void CloseAudioDev( demux_t *p_demux ); vlc_module_begin(); - set_description( _("dc1394 input") ); + set_description( N_("dc1394 input") ); set_capability( "access_demux", 10 ); add_shortcut( "dc1394" ); set_callbacks( Open, Close ); @@ -222,10 +227,7 @@ static int Open( vlc_object_t *p_this ) p_demux->p_sys = p_sys = malloc( sizeof( demux_sys_t ) ); if( !p_sys ) - { - msg_Err( p_demux, "not enough memory available" ); return VLC_ENOMEM; - } memset( p_sys, 0, sizeof( demux_sys_t ) ); memset( &fmt, 0, sizeof( es_format_t ) ); @@ -624,10 +626,8 @@ static void Close( vlc_object_t *p_this ) dc1394_destroy_handle( p_sys->fd_video ); CloseAudioDev( p_demux ); - if( p_sys->camera_nodes ) - free( p_sys->camera_nodes ); - if( p_sys->audio_device ) - free( p_sys->audio_device ); + free( p_sys->camera_nodes ); + free( p_sys->audio_device ); free( p_sys ); } @@ -748,7 +748,7 @@ static block_t *GrabAudio( demux_t *p_demux ) i_correct += buf_info.bytes; p_block->i_pts = p_block->i_dts = - mdate() - I64C(1000000) * (mtime_t)i_correct / + mdate() - INT64_C(1000000) * (mtime_t)i_correct / 2 / p_sys->channels / p_sys->i_sample_rate; return p_block; } @@ -795,7 +795,7 @@ static int Demux( demux_t *p_demux ) *****************************************************************************/ static int Control( demux_t *p_demux, int i_query, va_list args ) { - vlc_bool_t *pb; + bool *pb; int64_t *pi64; switch( i_query ) @@ -805,8 +805,8 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) case DEMUX_CAN_SEEK: case DEMUX_SET_PAUSE_STATE: case DEMUX_CAN_CONTROL_PACE: - pb = (vlc_bool_t*)va_arg( args, vlc_bool_t * ); - *pb = VLC_FALSE; + pb = (bool*)va_arg( args, bool * ); + *pb = false; return VLC_SUCCESS; case DEMUX_GET_PTS_DELAY: @@ -855,7 +855,7 @@ static int process_options( demux_t *p_demux ) "video size of 160x120 is actually disabled for lack of chroma " "support. It will relased ASAP, until then try an higher size " "(320x240 and 640x480 are fully supported)" ); - free(psz_dup); + free( psz_dup ); return VLC_EGENERIC; #if 0 p_sys->frame_size = MODE_160x120_YUV444; @@ -882,7 +882,7 @@ static int process_options( demux_t *p_demux ) " 160x120, 320x240, and 640x480. " "Please specify one of them. You have specified %s.", token ); - free(psz_dup); + free( psz_dup ); return VLC_EGENERIC; } msg_Dbg( p_demux, "Requested video size : %s",token ); @@ -910,7 +910,7 @@ static int process_options( demux_t *p_demux ) " 1.875, 3.75, 7.5, 15, 30, 60. " "Please specify one of them. You have specified %s.", token); - free(psz_dup); + free( psz_dup ); return VLC_EGENERIC; } msg_Dbg( p_demux, "Requested frame rate : %s",token ); @@ -925,7 +925,7 @@ static int process_options( demux_t *p_demux ) msg_Err( p_demux, "Bad brightness value '%s', " "must be an unsigned integer.", token ); - free(psz_dup); + free( psz_dup ); return VLC_EGENERIC; } } @@ -954,7 +954,7 @@ static int process_options( demux_t *p_demux ) msg_Err( p_demux, "Bad camera number '%s', " "must be an unsigned integer.", token ); - free(psz_dup); + free( psz_dup ); return VLC_EGENERIC; } } @@ -976,7 +976,7 @@ static int process_options( demux_t *p_demux ) msg_Err(p_demux, "Bad capture method value '%s', " "it can be 'raw1394' or 'video1394'.", token ); - free(psz_dup); + free( psz_dup ); return VLC_EGENERIC; } } @@ -1007,7 +1007,7 @@ static int process_options( demux_t *p_demux ) sscanf( token, "0x%llx", &p_sys->selected_uid ); } } - if( psz_dup ) free( psz_dup ); + free( psz_dup ); return VLC_SUCCESS; }