Commit 6488ad92 authored by Jean-Paul Saman's avatar Jean-Paul Saman

access/alsa.c: fixup 4b0e0dcd

Previous commit was wrong, this fixes it.
parent 4b0e0dcd
......@@ -363,7 +363,7 @@ static int Demux( demux_t *p_demux )
static block_t* GrabAudio( demux_t *p_demux )
{
demux_sys_t *p_sys = p_demux->p_sys;
int i_read, i_correct, i_error;
int i_read, i_correct;
block_t *p_block;
if( p_sys->p_block ) p_block = p_sys->p_block;
......@@ -379,13 +379,15 @@ static block_t* GrabAudio( demux_t *p_demux )
/* ALSA */
i_read = snd_pcm_readi( p_sys->p_alsa_pcm, p_block->p_buffer, p_sys->i_alsa_chunk_size );
if( i_read == -EAGAIN || ((i_read >= 0) && (i_read < p_sys->i_alsa_chunk_size)) )
i_error = snd_pcm_wait( p_sys->p_alsa_pcm, 10 ); /* See poll() comment in oss.c */
else i_error = i_read;
if( i_read == -EAGAIN )
{
snd_pcm_wait( p_sys->p_alsa_pcm, 10 ); /* See poll() comment in oss.c */
return NULL;
}
if( i_error <= 0 )
if( i_read <= 0 )
{
switch( i_error )
switch( i_read )
{
case -EPIPE:
/* xrun */
......
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