int snd_pcm_plugin_append(struct snd_pcm_plugin *plugin)
{
// 将plugin追加到链表的结尾[luther.gliethttp]
struct snd_pcm_runtime *runtime = plugin->plug->runtime;
plugin->next = NULL;
plugin->prev = runtime->oss.plugin_last; // 添加的plugin->prev指向当前链表的结尾元素
if (runtime->oss.plugin_last) { // 如果当前plugin非空
runtime->oss.plugin_last->next = plugin; // 将新plugin追加到当前last的next上
runtime->oss.plugin_last = plugin; // 新加入的plugin作为链表上的last
} else {
runtime->oss.plugin_last =
runtime->oss.plugin_first = plugin; // 当前链表还空,所以新加入的plugin既是first又是last.
}
return 0;
}
阅读(888) | 评论(0) | 转发(0) |