Changeset 5639:b8cdcac37ffe in roaraudio for roard/plugins.c
- Timestamp:
- 09/10/12 15:56:42 (12 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
roard/plugins.c
r5592 r5639 30 30 static struct _roard_plugin { 31 31 struct roar_dl_lhandle * lhandle; 32 struct roard_plugins_sched * sched;33 32 int protocols[MAX_PROTOS]; 34 33 } g_plugins[MAX_PLUGINS]; … … 81 80 ROAR_DBG("plugins_delete(plugin=%p) = ?", plugin); 82 81 83 if ( plugin->sched != NULL ) {84 if ( plugin->sched->free != NULL ) {85 roar_dl_context_restore(plugin->lhandle);86 plugin->sched->free();87 roar_dl_context_store(plugin->lhandle);88 }89 }90 91 82 roar_dl_appsched_trigger(plugin->lhandle, ROAR_DL_APPSCHED_FREE); 92 83 … … 109 100 110 101 _pp = plugin; 111 _pp->sched = NULL;112 102 113 103 if ( roar_dl_ra_init(plugin->lhandle, NULL, NULL) == -1 ) { … … 117 107 } 118 108 119 if ( plugin->sched != NULL ) {120 if ( plugin->sched->init != NULL ) {121 roar_dl_context_restore(plugin->lhandle);122 plugin->sched->init();123 roar_dl_context_store(plugin->lhandle);124 }125 }126 127 109 roar_dl_appsched_trigger(plugin->lhandle, ROAR_DL_APPSCHED_INIT); 128 110 … … 185 167 for (i = 0; i < MAX_PLUGINS; i++) { 186 168 if ( g_plugins[i].lhandle != NULL ) { 187 if ( g_plugins[i].sched != NULL ) {188 if ( g_plugins[i].sched->update != NULL ) {189 roar_dl_context_restore(g_plugins[i].lhandle);190 if ( g_plugins[i].sched->update() == -1 )191 ret = -1;192 roar_dl_context_store(g_plugins[i].lhandle);193 }194 }195 169 if ( roar_dl_appsched_trigger(g_plugins[i].lhandle, ROAR_DL_APPSCHED_UPDATE) == -1 ) 196 170 if ( roar_error != ROAR_ERROR_NOENT ) … … 261 235 } else { 262 236 printf(" %s\n", libname->libname); 263 printf(" Flags: %s\n", p->sched != NULL ? "roardsched" :"");237 printf(" Flags: %s\n", ""); 264 238 if ( libname->description != NULL ) 265 239 printf(" Description: %s\n", libname->description); … … 268 242 } 269 243 } 270 }271 272 int plugins_reg_sched(struct roard_plugins_sched * sched) {273 if ( _pp == NULL )274 return -1;275 276 _pp->sched = sched;277 278 return 0;279 244 } 280 245
Note: See TracChangeset
for help on using the changeset viewer.