@@ -292,7 +292,9 @@ av_cold int ff_alsa_open(AVFormatContext *ctx, snd_pcm_stream_t mode,
fail:
snd_pcm_hw_params_free(hw_params);
fail1:
+ snd_pcm_hw_free(h);
snd_pcm_close(h);
+ snd_config_update_free_global();
return AVERROR(EIO);
}
@@ -302,10 +304,12 @@ av_cold int ff_alsa_close(AVFormatContext *s1)
snd_pcm_nonblock(s->h, 0);
snd_pcm_drain(s->h);
+ snd_pcm_hw_free(s->h);
av_freep(&s->reorder_buf);
if (CONFIG_ALSA_INDEV)
ff_timefilter_destroy(s->timefilter);
snd_pcm_close(s->h);
+ snd_config_update_free_global();
return 0;
}