Chinaunix首页 | 论坛 | 博客
  • 博客访问: 15374731
  • 博文数量: 2005
  • 博客积分: 11986
  • 博客等级: 上将
  • 技术积分: 22535
  • 用 户 组: 普通用户
  • 注册时间: 2007-05-17 13:56
文章分类

全部博文(2005)

文章存档

2014年(2)

2013年(2)

2012年(16)

2011年(66)

2010年(368)

2009年(743)

2008年(491)

2007年(317)

分类: LINUX

2009-11-17 20:44:25

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;
}
阅读(694) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~