Commit 24908209 authored by Christophe Massiot's avatar Christophe Massiot
Browse files

* modules/access/dvb: Set the DVR device in non-blocking mode because it

   sometimes blocks on read() after returning from select().
parent c4a2920f
......@@ -384,19 +384,19 @@ static block_t *Block( access_t *p_access )
if ( FD_ISSET( p_sys->i_handle, &fds ) )
{
p_block = block_New( p_access,
p_sys->i_read_once * TS_PACKET_SIZE );
if( ( p_block->i_buffer = read( p_sys->i_handle, p_block->p_buffer,
p_sys->i_read_once * TS_PACKET_SIZE ) ) <= 0 )
{
msg_Warn( p_access, "read failed (%s)", strerror(errno) );
block_Release( p_block );
continue;
}
break;
}
}
p_block = block_New( p_access, p_sys->i_read_once * TS_PACKET_SIZE );
if( ( p_block->i_buffer = read( p_sys->i_handle, p_block->p_buffer,
p_sys->i_read_once*TS_PACKET_SIZE ) ) <= 0 )
{
msg_Err( p_access, "read failed (%s)", strerror(errno) );
block_Release( p_block );
return NULL;
}
if( p_sys->i_read_once < DVB_READ_ONCE )
p_sys->i_read_once++;
......
......@@ -1177,6 +1177,12 @@ int E_(DVROpen)( access_t * p_access )
return VLC_EGENERIC;
}
if( fcntl( p_sys->i_handle, F_SETFL, O_NONBLOCK ) == -1 )
{
msg_Warn( p_access, "DVROpen: couldn't set non-blocking mode (%s)",
strerror(errno) );
}
return VLC_SUCCESS;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment