GF_EXPORT void gf_term_download_del(GF_DownloadSession * sess) { Bool locked; GF_ClientService *serv; if (!sess) return; serv = (GF_ClientService *)gf_dm_sess_get_private(sess); /*avoid sending data back to user*/ gf_dm_sess_abort(sess); locked = gf_mx_try_lock(serv->term->media_queue_mx); /*unregister from service*/ gf_list_del_item(serv->dnloads, sess); /*same as service: this may be called in the downloader thread (typically when download fails) so we must queue the downloader and let the term delete it later on*/ gf_list_add(serv->term->net_services_to_remove, sess); if (locked) gf_term_lock_media_queue(serv->term, 0); }
void mpdin_dash_io_abort(GF_DASHFileIO *dashio, GF_DASHFileIOSession session) { gf_dm_sess_abort((GF_DownloadSession *)session); }