Commit 27f593d3 authored by Jean-Paul Saman's avatar Jean-Paul Saman

access/alsa.c: Do not hang when stopping to record.

The code would block on the Audio Capture Thread that did not finish,
when the recording was stopped. By explicitly checking for the module
to be alive in the Audio Capture Thread this problem is resovled.
parent 514a4f6c
......@@ -445,8 +445,8 @@ static int Demux( demux_t *p_demux )
es_out_Send( p_demux->out, p_sys->p_es, p_block );
p_block = NULL;
if( p_sys->i_next_demux_date <= 0 &&
i_pts >= p_sys->i_next_demux_date )
if( (p_sys->i_next_demux_date > 0) &&
(i_pts >= p_sys->i_next_demux_date) )
break;
} while( vlc_object_alive(p_demux) );
......@@ -461,7 +461,7 @@ static void *AudioThread( vlc_object_t *p_this )
block_t *p_block = NULL;
do
while( vlc_object_alive( p_grab ) && vlc_object_alive(p_demux) )
{
p_block = GrabAudio( p_demux );
if( p_block )
......@@ -470,8 +470,7 @@ static void *AudioThread( vlc_object_t *p_this )
block_FifoPut( p_sys->p_grab->p_fifo, p_block );
p_block = NULL;
}
} while( vlc_object_alive( p_grab ) );
}
if( p_block )
block_Release( p_block );
......@@ -602,14 +601,13 @@ static int OpenAudioDevAlsa( demux_t *p_demux, const char *psz_device )
psz_device, snd_strerror( i_err ) );
goto adev_fail;
}
#if 0
if( ( i_err = snd_pcm_nonblock( p_sys->p_alsa_pcm, 1 ) ) < 0)
{
msg_Err( p_demux, "Cannot set ALSA nonblock (%s)",
snd_strerror( i_err ) );
goto adev_fail;
}
#endif
/* Begin setting hardware parameters */
......
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