if (be_app == NULL) { resume_thread(spawn_thread(bapp_thread, "ffmpeg BApplication", B_NORMAL_PRIORITY, NULL)); while (!own_BApp_created) snooze(50000); }
main_thid = find_thread(NULL);
int audio_init(void){    /* needed by libmedia */    if (be_app == NULL) {        resume_thread(spawn_thread(bapp_thread, "ffmpeg BApplication", B_NORMAL_PRIORITY, NULL));        while (!own_BApp_created)            snooze(50000);    }    av_register_input_format(&audio_in_format);    av_register_output_format(&audio_out_format);    return 0;}