mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-12-17 08:56:45 -05:00
Fixed premature slave close
This commit is contained in:
parent
c922181ab5
commit
6a9037d087
1 changed files with 6 additions and 6 deletions
|
|
@ -74,23 +74,23 @@ void debug_start(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
||||||
|
|
||||||
void debug_stop(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
void debug_stop(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "stop\n");
|
fprintf(stderr, "\nstop\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void debug_update(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
void debug_update(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
snd_pcm_meter_t *meter = scope->pcm->private_data;
|
snd_pcm_meter_t *meter = scope->pcm->private_data;
|
||||||
fprintf(stderr, "update %ld\r", meter->now);
|
fprintf(stderr, "update %08ld\r", meter->now);
|
||||||
}
|
}
|
||||||
|
|
||||||
void debug_reset(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
void debug_reset(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "reset\n");
|
fprintf(stderr, "\nreset\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void debug_close(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
void debug_close(snd_pcm_meter_scope_t *scope ATTRIBUTE_UNUSED)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "close\n");
|
fprintf(stderr, "\nclose\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
snd_pcm_meter_scope_t debug_scope = {
|
snd_pcm_meter_scope_t debug_scope = {
|
||||||
|
|
@ -278,8 +278,6 @@ static int snd_pcm_meter_close(snd_pcm_t *pcm)
|
||||||
{
|
{
|
||||||
snd_pcm_meter_t *meter = pcm->private_data;
|
snd_pcm_meter_t *meter = pcm->private_data;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
if (meter->close_slave)
|
|
||||||
err = snd_pcm_close(meter->slave);
|
|
||||||
meter->closed = 1;
|
meter->closed = 1;
|
||||||
pthread_mutex_lock(&meter->running_mutex);
|
pthread_mutex_lock(&meter->running_mutex);
|
||||||
pthread_cond_signal(&meter->running_cond);
|
pthread_cond_signal(&meter->running_cond);
|
||||||
|
|
@ -289,6 +287,8 @@ static int snd_pcm_meter_close(snd_pcm_t *pcm)
|
||||||
pthread_mutex_destroy(&meter->update_mutex);
|
pthread_mutex_destroy(&meter->update_mutex);
|
||||||
pthread_mutex_destroy(&meter->running_mutex);
|
pthread_mutex_destroy(&meter->running_mutex);
|
||||||
pthread_cond_destroy(&meter->running_cond);
|
pthread_cond_destroy(&meter->running_cond);
|
||||||
|
if (meter->close_slave)
|
||||||
|
err = snd_pcm_close(meter->slave);
|
||||||
free(meter);
|
free(meter);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue