static int snd_pcm_oss_plugin_clear(struct snd_pcm_substream *substream)
{
struct snd_pcm_runtime *runtime = substream->runtime;
struct snd_pcm_plugin *plugin, *next;
plugin = runtime->oss.plugin_first;
while (plugin) {
next = plugin->next;
snd_pcm_plugin_free(plugin); // 释放链表上所有plugin
plugin = next;
}
runtime->oss.plugin_first = runtime->oss.plugin_last = NULL; // 清空oss.plugin_first链表[luther.gliethttp]
return 0;
}
int snd_pcm_plugin_free(struct snd_pcm_plugin *plugin)
{
if (! plugin)
return 0;
if (plugin->private_free)
plugin->private_free(plugin);
kfree(plugin->buf_channels); // 释放plugin->buf_channels,它可以等于0
vfree(plugin->buf); // 释放plugin->buf,它可以等于0
kfree(plugin); // 释放plugin内存
return 0;
}
阅读(730) | 评论(0) | 转发(0) |