X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Faccess%2Fv4l2%2Fv4l2.c;h=ebff1130e1c59783fb2a69f75a646b4cb686ff04;hb=de587c237065de4696d9d035d0504cdf34990d87;hp=aa67b3633e01befa04d5e3a199cdb6c1f8b7fd2d;hpb=3ccefd743ac2497a40acf007ba1a4d041b81d2a8;p=vlc diff --git a/modules/access/v4l2/v4l2.c b/modules/access/v4l2/v4l2.c index aa67b3633e..ebff1130e1 100644 --- a/modules/access/v4l2/v4l2.c +++ b/modules/access/v4l2/v4l2.c @@ -1323,7 +1323,7 @@ static ssize_t AccessRead( access_t * p_access, uint8_t * p_buffer, size_t i_len do { - if( p_access->b_die ) + if( !vlc_object_alive (p_access) ) return 0; ufd.revents = 0; @@ -1761,32 +1761,25 @@ static int InitUserP( demux_t *p_demux, int i_fd, unsigned int i_buffer_size ) 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; } @@ -3106,10 +3099,10 @@ static void ControlListPrint( vlc_object_t *p_obj, int i_fd, 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 ); }