EXPORT void iaxc_shutdown() { iaxc_dump_all_calls(); get_iaxc_lock(); if ( !test_mode ) { audio_driver.destroy(&audio_driver); audio_destroy(); #ifdef USE_VIDEO video_destroy(); #endif } /* destroy enocders and decoders for all existing calls */ if ( calls ) { int i; for ( i=0 ; i<max_calls ; i++ ) { if ( calls[i].encoder ) calls[i].encoder->destroy(calls[i].encoder); if ( calls[i].decoder ) calls[i].decoder->destroy(calls[i].decoder); if ( calls[i].vencoder ) calls[i].vencoder->destroy(calls[i].vencoder); if ( calls[i].vdecoder ) calls[i].vdecoder->destroy(calls[i].vdecoder); } free(calls); calls = NULL; } put_iaxc_lock(); #ifdef WIN32 closesocket(iax_get_fd()); //fd: #endif free(calls); MUTEXDESTROY(&event_queue_lock); MUTEXDESTROY(&iaxc_lock); }
void result_destroy(MediaScanResult *r) { if (r->error) error_destroy(r->error); switch (r->type) { case TYPE_VIDEO: if (r->type_data.video) video_destroy((MediaScanVideo *)r->type_data.video); break; // XXX other type_data types default: break; } LOG_MEM("destroy MediaScanResult @ %p\n", r); free(r); }