do
{
- if( p_access->b_die )
+ if( !vlc_object_alive (p_access) )
return 0;
ufd.revents = 0;
/* Test for overrun */
if( i_correction_delta > p_sys->i_audio_max_frame_size )
{
- msg_Warn( p_demux, "ALSA read overrun (%d > %d)",
+ msg_Warn( p_demux, "ALSA read overrun (%zu > %zu)",
i_correction_delta, p_sys->i_audio_max_frame_size );
i_correction_delta = p_sys->i_audio_max_frame_size;
snd_pcm_prepare( p_sys->p_alsa_pcm );
p_sys->p_buffers = calloc( 1, sizeof( *p_sys->p_buffers ) );
if( !p_sys->p_buffers )
- {
- msg_Err( p_demux, "Out of memory" );
goto open_failed;
- }
p_sys->p_buffers[0].length = i_buffer_size;
p_sys->p_buffers[0].start = malloc( i_buffer_size );
if( !p_sys->p_buffers[0].start )
- {
- msg_Err( p_demux, "Out of memory" );
goto open_failed;
- }
return VLC_SUCCESS;
if( ioctl( i_fd, VIDIOC_REQBUFS, &req ) < 0 )
{
msg_Err( p_demux, "device does not support user pointer i/o" );
- goto open_failed;
+ return VLC_EGENERIC;
}
p_sys->p_buffers = calloc( 4, sizeof( *p_sys->p_buffers ) );
if( !p_sys->p_buffers )
- {
- msg_Err( p_demux, "Out of memory" );
goto open_failed;
- }
for( p_sys->i_nbuffers = 0; p_sys->i_nbuffers < 4; ++p_sys->i_nbuffers )
{
p_sys->p_buffers[p_sys->i_nbuffers].length = i_buffer_size;
- posix_memalign( &p_sys->p_buffers[p_sys->i_nbuffers].start,
- /* boundary */ i_page_size, i_buffer_size );
-
- if( !p_sys->p_buffers[p_sys->i_nbuffers].start )
- {
- msg_Err( p_demux, "out of memory" );
+ if( posix_memalign( &p_sys->p_buffers[p_sys->i_nbuffers].start,
+ /* boundary */ i_page_size, i_buffer_size ) )
goto open_failed;
- }
}
return VLC_SUCCESS;
open_failed:
+ free( p_sys->p_buffers );
return VLC_EGENERIC;
}
if( b_demux )
var_AddCallback( p_obj, psz_name,
- DemuxControlCallback, (void*)queryctrl.id );
+ DemuxControlCallback, (void*)(intptr_t)queryctrl.id );
else
var_AddCallback( p_obj, psz_name,
- AccessControlCallback, (void*)queryctrl.id );
+ AccessControlCallback, (void*)(intptr_t)queryctrl.id );
free( psz_name );
}