#include <vlc_demux.h>
#include <vlc_fs.h>
+#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
/* Wait for data */
if( poll( &fd, 1, 10 ) ) /* Timeout after 0.01 seconds. Bigger delays are an issue when used with/as an input-slave since all the inputs run in the same thread. */
{
+ if( errno == EINTR )
+ continue;
if( fd.revents & (POLLIN|POLLPRI) )
{
p_block = GrabAudio( p_demux );
if( !p_block )
{
msg_Warn( p_demux, "cannot get block" );
- return 0;
+ return NULL;
}
p_sys->p_block = p_block;
i_read = read( p_sys->i_fd, p_block->p_buffer,
p_sys->i_max_frame_size );
- if( i_read <= 0 ) return 0;
+ if( i_read <= 0 ) return NULL;
p_block->i_buffer = i_read;
- p_sys->p_block = 0;
+ p_sys->p_block = NULL;
/* Correct the date because of kernel buffering */
i_correct = i_read;