void groove_encoder_destroy(struct GrooveEncoder *encoder) { struct GrooveEncoderPrivate *e = (struct GrooveEncoderPrivate *) encoder; if (e->sink) groove_sink_destroy(e->sink); if (e->audioq) groove_queue_destroy(e->audioq); if (e->encode_head_mutex_inited) pthread_mutex_destroy(&e->encode_head_mutex); if (e->drain_cond_inited) pthread_cond_destroy(&e->drain_cond); if (e->avio) av_free(e->avio); if (e->avio_buf) av_free(e->avio_buf); if (e->metadata) av_dict_free(&e->metadata); av_free(e); }
void groove_sink_destroy(struct GrooveSink *sink) { if (!sink) return; struct GrooveSinkPrivate *s = (struct GrooveSinkPrivate *) sink; if (s->audioq) groove_queue_destroy(s->audioq); av_free(s); }
void groove_fingerprinter_destroy(struct GrooveFingerprinter *printer) { if (!printer) return; struct GrooveFingerprinterPrivate *p = (struct GrooveFingerprinterPrivate *) printer; if (p->sink) groove_sink_destroy(p->sink); if (p->info_queue) groove_queue_destroy(p->info_queue); if (p->info_head_mutex_inited) pthread_mutex_destroy(&p->info_head_mutex); if (p->drain_cond_inited) pthread_cond_destroy(&p->drain_cond); deallocate(p); }