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